]> git.ipfire.org Git - thirdparty/git.git/commitdiff
gc: rename keep_base_pack variable for --keep-largest-pack
authorÆvar Arnfjörð Bjarmason <avarab@gmail.com>
Fri, 20 Nov 2020 11:55:22 +0000 (12:55 +0100)
committerJunio C Hamano <gitster@pobox.com>
Sat, 21 Nov 2020 19:39:59 +0000 (11:39 -0800)
As noted in an earlier change the keep_base_pack variable name is a
relic from an earlier on-list version of ae4e89e549 ("gc: add
--keep-largest-pack option", 2018-04-15) before it was renamed to
--keep-largest-pack.

Let's change the variable name to avoid that confusion, it's easier to
read the code if there's a 1=1 mapping between the variable name and
option name.

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

index 3f76bf4aa73d1a05d7a6350da71ea628819ea30a..19e536dcc7fcaea708b288d3a5c187f8b50c193f 100644 (file)
@@ -530,7 +530,7 @@ int cmd_gc(int argc, const char **argv, const char *prefix)
        const char *name;
        pid_t pid;
        int daemonized = 0;
-       int keep_base_pack = -1;
+       int keep_largest_pack = -1;
        timestamp_t dummy;
 
        struct option builtin_gc_options[] = {
@@ -544,7 +544,7 @@ int cmd_gc(int argc, const char **argv, const char *prefix)
                OPT_BOOL_F(0, "force", &force,
                           N_("force running gc even if there may be another gc running"),
                           PARSE_OPT_NOCOMPLETE),
-               OPT_BOOL(0, "keep-largest-pack", &keep_base_pack,
+               OPT_BOOL(0, "keep-largest-pack", &keep_largest_pack,
                         N_("repack all other packs except the largest pack")),
                OPT_END()
        };
@@ -621,8 +621,8 @@ int cmd_gc(int argc, const char **argv, const char *prefix)
        } else {
                struct string_list keep_pack = STRING_LIST_INIT_NODUP;
 
-               if (keep_base_pack != -1) {
-                       if (keep_base_pack)
+               if (keep_largest_pack != -1) {
+                       if (keep_largest_pack)
                                find_base_packs(&keep_pack, 0);
                } else if (big_pack_threshold) {
                        find_base_packs(&keep_pack, big_pack_threshold);