Skip to content

Commit 1c04cdd

Browse files
committed
Merge branch 'ab/gc-keep-base-option'
Fix an option name in "gc" documentation. * ab/gc-keep-base-option: gc: rename keep_base_pack variable for --keep-largest-pack gc docs: change --keep-base-pack to --keep-largest-pack
2 parents 1242501 + 793c146 commit 1c04cdd

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

Documentation/config/gc.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,9 +44,9 @@ gc.autoDetach::
4444

4545
gc.bigPackThreshold::
4646
If non-zero, all packs larger than this limit are kept when
47-
`git gc` is run. This is very similar to `--keep-base-pack`
47+
`git gc` is run. This is very similar to `--keep-largest-pack`
4848
except that all packs that meet the threshold are kept, not
49-
just the base pack. Defaults to zero. Common unit suffixes of
49+
just the largest pack. Defaults to zero. Common unit suffixes of
5050
'k', 'm', or 'g' are supported.
5151
+
5252
Note that if the number of kept packs is more than gc.autoPackLimit,
@@ -57,7 +57,7 @@ gc.autoPackLimit and gc.bigPackThreshold should be respected again.
5757
If the amount of memory estimated for `git repack` to run smoothly is
5858
not available and `gc.bigPackThreshold` is not set, the largest pack
5959
will also be excluded (this is the equivalent of running `git gc` with
60-
`--keep-base-pack`).
60+
`--keep-largest-pack`).
6161

6262
gc.writeCommitGraph::
6363
If true, then gc will rewrite the commit-graph file when

builtin/gc.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -534,7 +534,7 @@ int cmd_gc(int argc, const char **argv, const char *prefix)
534534
const char *name;
535535
pid_t pid;
536536
int daemonized = 0;
537-
int keep_base_pack = -1;
537+
int keep_largest_pack = -1;
538538
timestamp_t dummy;
539539

540540
struct option builtin_gc_options[] = {
@@ -548,7 +548,7 @@ int cmd_gc(int argc, const char **argv, const char *prefix)
548548
OPT_BOOL_F(0, "force", &force,
549549
N_("force running gc even if there may be another gc running"),
550550
PARSE_OPT_NOCOMPLETE),
551-
OPT_BOOL(0, "keep-largest-pack", &keep_base_pack,
551+
OPT_BOOL(0, "keep-largest-pack", &keep_largest_pack,
552552
N_("repack all other packs except the largest pack")),
553553
OPT_END()
554554
};
@@ -625,8 +625,8 @@ int cmd_gc(int argc, const char **argv, const char *prefix)
625625
} else {
626626
struct string_list keep_pack = STRING_LIST_INIT_NODUP;
627627

628-
if (keep_base_pack != -1) {
629-
if (keep_base_pack)
628+
if (keep_largest_pack != -1) {
629+
if (keep_largest_pack)
630630
find_base_packs(&keep_pack, 0);
631631
} else if (big_pack_threshold) {
632632
find_base_packs(&keep_pack, big_pack_threshold);

0 commit comments

Comments
 (0)