summaryrefslogtreecommitdiff
path: root/builtin/var.c
diff options
context:
space:
mode:
authorLibravatar Ævar Arnfjörð Bjarmason <avarab@gmail.com>2021-12-22 05:06:43 +0100
committerLibravatar Junio C Hamano <gitster@pobox.com>2021-12-22 16:24:13 -0800
commit20d6b6868c1446d548094a0a8aa4393a9c58447c (patch)
tree0c8ce80b86f59a3814282d81851ca7218132091d /builtin/var.c
parentreflog: change one->many worktree->refnames to use a string_list (diff)
downloadtgif-20d6b6868c1446d548094a0a8aa4393a9c58447c.tar.xz
reflog expire: use "switch" over enum values
Change code added in 03cb91b18cc (reflog --expire-unreachable: special case entries in "HEAD" reflog, 2010-04-09) to use a "switch" statement with an exhaustive list of "case" statements instead of doing numeric comparisons against the enum labels. Now we won't assume that "x != UE_ALWAYS" means "(x == UE_HEAD || x || UE_NORMAL)". That assumption is true now, but we'd introduce subtle bugs here if that were to change, now the compiler will notice and error out on such errors. Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin/var.c')
0 files changed, 0 insertions, 0 deletions