diff options
author | Junio C Hamano <gitster@pobox.com> | 2019-09-09 12:26:36 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2019-09-09 12:26:36 -0700 |
commit | f4f8dfe127918241c1e3448436d32a89f13fa5a8 (patch) | |
tree | 7da8889b7333a7744024f53192f397f68b5b9761 /builtin/gc.c | |
parent | Merge branch 'jk/eoo' (diff) | |
parent | repo-settings: create feature.experimental setting (diff) | |
download | tgif-f4f8dfe127918241c1e3448436d32a89f13fa5a8.tar.xz |
Merge branch 'ds/feature-macros'
A mechanism to affect the default setting for a (related) group of
configuration variables is introduced.
* ds/feature-macros:
repo-settings: create feature.experimental setting
repo-settings: create feature.manyFiles setting
repo-settings: parse core.untrackedCache
commit-graph: turn on commit-graph by default
t6501: use 'git gc' in quiet mode
repo-settings: consolidate some config settings
Diffstat (limited to 'builtin/gc.c')
-rw-r--r-- | builtin/gc.c | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/builtin/gc.c b/builtin/gc.c index 305fb0f45a..a22b6ff683 100644 --- a/builtin/gc.c +++ b/builtin/gc.c @@ -41,7 +41,6 @@ static int aggressive_depth = 50; static int aggressive_window = 250; static int gc_auto_threshold = 6700; static int gc_auto_pack_limit = 50; -static int gc_write_commit_graph; static int detach_auto = 1; static timestamp_t gc_log_expire_time; static const char *gc_log_expire = "1.day.ago"; @@ -148,7 +147,6 @@ static void gc_config(void) git_config_get_int("gc.aggressivedepth", &aggressive_depth); git_config_get_int("gc.auto", &gc_auto_threshold); git_config_get_int("gc.autopacklimit", &gc_auto_pack_limit); - git_config_get_bool("gc.writecommitgraph", &gc_write_commit_graph); git_config_get_bool("gc.autodetach", &detach_auto); git_config_get_expiry("gc.pruneexpire", &prune_expire); git_config_get_expiry("gc.worktreepruneexpire", &prune_worktrees_expire); @@ -685,11 +683,11 @@ int cmd_gc(int argc, const char **argv, const char *prefix) clean_pack_garbage(); } - if (gc_write_commit_graph && - write_commit_graph_reachable(get_object_directory(), - !quiet && !daemonized ? COMMIT_GRAPH_WRITE_PROGRESS : 0, - NULL)) - return 1; + prepare_repo_settings(the_repository); + if (the_repository->settings.gc_write_commit_graph == 1) + write_commit_graph_reachable(get_object_directory(), + !quiet && !daemonized ? COMMIT_GRAPH_WRITE_PROGRESS : 0, + NULL); if (auto_gc && too_many_loose_objects()) warning(_("There are too many unreachable loose objects; " |