]> git.ipfire.org Git - thirdparty/git.git/commitdiff
ref-filter: add braces to if/else if/else chain
authorÆvar Arnfjörð Bjarmason <avarab@gmail.com>
Thu, 7 Jan 2021 09:51:49 +0000 (10:51 +0100)
committerJunio C Hamano <gitster@pobox.com>
Thu, 7 Jan 2021 23:13:21 +0000 (15:13 -0800)
Per the CodingGuidelines add braces to an if/else if/else chain where
only the "else" had braces. This is in preparation for a subsequent
change where the "else if" will have lines added to it.

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
ref-filter.c

index aa260bfd0995564e085f69b5b1c7ecaf4b49f359..e4c162a8c348b3fd6978d1b2606d4a0b6f86cf4e 100644 (file)
@@ -2364,11 +2364,11 @@ static int cmp_ref_sorting(struct ref_sorting *s, struct ref_array_item *a, stru
                die("%s", err.buf);
        strbuf_release(&err);
        cmp_fn = s->ignore_case ? strcasecmp : strcmp;
-       if (s->version)
+       if (s->version) {
                cmp = versioncmp(va->s, vb->s);
-       else if (cmp_type == FIELD_STR)
+       } else if (cmp_type == FIELD_STR) {
                cmp = cmp_fn(va->s, vb->s);
-       else {
+       else {
                if (va->value < vb->value)
                        cmp = -1;
                else if (va->value == vb->value)