summaryrefslogtreecommitdiff
path: root/builtin/gc.c
diff options
context:
space:
mode:
Diffstat (limited to 'builtin/gc.c')
-rw-r--r--builtin/gc.c14
1 files changed, 6 insertions, 8 deletions
diff --git a/builtin/gc.c b/builtin/gc.c
index acfd5b9cf6..592b20fb89 100644
--- a/builtin/gc.c
+++ b/builtin/gc.c
@@ -534,7 +534,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[] = {
@@ -548,7 +548,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()
};
@@ -625,8 +625,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);
@@ -1253,10 +1253,8 @@ static struct maintenance_task tasks[] = {
static int compare_tasks_by_selection(const void *a_, const void *b_)
{
- const struct maintenance_task *a, *b;
-
- a = (const struct maintenance_task *)&a_;
- b = (const struct maintenance_task *)&b_;
+ const struct maintenance_task *a = a_;
+ const struct maintenance_task *b = b_;
return b->selected_order - a->selected_order;
}