From: Junio C Hamano Date: Tue, 8 Dec 2020 23:11:20 +0000 (-0800) Subject: Merge branch 'rs/maintenance-run-outside-repo' X-Git-Tag: v2.30.0-rc0~17 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=f2a75cb312d775c51c2029bcce227e3ea078c5f8;p=thirdparty%2Fgit.git Merge branch 'rs/maintenance-run-outside-repo' "git maintenance run/start/stop" needed to be run in a repository to hold the lockfile they use, but didn't make sure they are actually in a repository, which has been corrected. * rs/maintenance-run-outside-repo: t7900: fix typo: "test_execpt_success" maintenance: fix SEGFAULT when no repository --- f2a75cb312d775c51c2029bcce227e3ea078c5f8 diff --cc builtin/gc.c index 592b20fb89,ebb0158308..b57fda4924 --- a/builtin/gc.c +++ b/builtin/gc.c @@@ -1487,12 -1482,9 +1483,9 @@@ static int maintenance_unregister(void { struct child_process config_unset = CHILD_PROCESS_INIT; - if (!the_repository || !the_repository->gitdir) - return error(_("no current repository to unregister")); - config_unset.git_cmd = 1; strvec_pushl(&config_unset.args, "config", "--global", "--unset", - "maintenance.repo", + "--fixed-value", "maintenance.repo", the_repository->worktree ? the_repository->worktree : the_repository->gitdir, NULL);