]> git.ipfire.org Git - thirdparty/git.git/commitdiff
Merge branch 'rs/maintenance-run-outside-repo'
authorJunio C Hamano <gitster@pobox.com>
Tue, 8 Dec 2020 23:11:20 +0000 (15:11 -0800)
committerJunio C Hamano <gitster@pobox.com>
Tue, 8 Dec 2020 23:11:21 +0000 (15:11 -0800)
"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

1  2 
builtin/gc.c
t/t7900-maintenance.sh

diff --cc builtin/gc.c
index 592b20fb89445c49207742b8647da8accc42a5c1,ebb0158308728b389d91b20478a89b7d0d87ede5..b57fda49240ecae6beb9889711169e5a6590e3af
@@@ -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);
Simple merge