]> git.ipfire.org Git - thirdparty/git.git/commitdiff
fetch: trivially refactor assignment to ref_nr
authorÆvar Arnfjörð Bjarmason <avarab@gmail.com>
Fri, 9 Feb 2018 20:32:01 +0000 (20:32 +0000)
committerJunio C Hamano <gitster@pobox.com>
Fri, 9 Feb 2018 21:10:11 +0000 (13:10 -0800)
Trivially refactor an assignment to make a subsequent patch
smaller. The "ref_nr" variable is initialized to 0 earlier, just as
"j" is, and "j" is only incremented in that loop, so this change isn't
a logic error.

This change simplifies a subsequent change, which will split the
incrementing of "ref_nr" into two blocks.

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

index b34665db9e407ec3cdc8ecd9badda068927dcd20..72085e30b90bec96932a0aa2260ff4bfd5a04b93 100644 (file)
@@ -1301,8 +1301,8 @@ static int fetch_one(struct remote *remote, int argc, const char **argv)
                                                    argv[i], argv[i]);
                        } else
                                refs[j++] = argv[i];
+                       ref_nr++;
                }
-               ref_nr = j;
        }
 
        sigchain_push_common(unlock_pack_on_signal);