diff options
| author | Ævar Arnfjörð Bjarmason <avarab@gmail.com> | 2021-12-22 05:06:43 +0100 |
|---|---|---|
| committer | Junio C Hamano <gitster@pobox.com> | 2021-12-22 16:24:13 -0800 |
| commit | 20d6b6868c1446d548094a0a8aa4393a9c58447c (patch) | |
| tree | 0c8ce80b86f59a3814282d81851ca7218132091d /refs/files-backend.c | |
| parent | f2919bae9836d552a399b67f4f7d26d30128b6d5 (diff) | |
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 'refs/files-backend.c')
0 files changed, 0 insertions, 0 deletions
