diff options
| author | Junio C Hamano <gitster@pobox.com> | 2024-08-26 11:32:20 -0700 |
|---|---|---|
| committer | Junio C Hamano <gitster@pobox.com> | 2024-08-26 11:32:20 -0700 |
| commit | 1e8962ee082934a60b5fc71fab0e36cb1cab39bd (patch) | |
| tree | 832b7058ac8f5b9d941ab2cbfd10e84854262d21 /read-cache.c | |
| parent | 6a09c36371cbb902c573aee38d7cfd38f884f448 (diff) | |
| parent | 98077d06b28b97d508c389886ee5014056707a5e (diff) | |
| download | git-1e8962ee082934a60b5fc71fab0e36cb1cab39bd.tar.gz | |
Merge branch 'ps/maintenance-detach-fix'
Maintenance tasks other than "gc" now properly go background when
"git maintenance" runs them.
* ps/maintenance-detach-fix:
run-command: fix detaching when running auto maintenance
builtin/maintenance: add a `--detach` flag
builtin/gc: add a `--detach` flag
builtin/gc: stop processing log file on signal
builtin/gc: fix leaking config values
builtin/gc: refactor to read config into structure
config: fix constness of out parameter for `git_config_get_expiry()`
Diffstat (limited to 'read-cache.c')
| -rw-r--r-- | read-cache.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/read-cache.c b/read-cache.c index 5464398162..4e67dc182e 100644 --- a/read-cache.c +++ b/read-cache.c @@ -3195,18 +3195,24 @@ static int write_split_index(struct index_state *istate, return ret; } -static const char *shared_index_expire = "2.weeks.ago"; - static unsigned long get_shared_index_expire_date(void) { static unsigned long shared_index_expire_date; static int shared_index_expire_date_prepared; if (!shared_index_expire_date_prepared) { + const char *shared_index_expire = "2.weeks.ago"; + char *value = NULL; + repo_config_get_expiry(the_repository, "splitindex.sharedindexexpire", - &shared_index_expire); + &value); + if (value) + shared_index_expire = value; + shared_index_expire_date = approxidate(shared_index_expire); shared_index_expire_date_prepared = 1; + + free(value); } return shared_index_expire_date; |
