Merge branch 'ds/maintenance-part-3'
"git maintenance" command had trouble working in a directory whose pathname contained an ERE metacharacter like '+'. * ds/maintenance-part-3: maintenance: use 'git config --fixed-value'maint
commit
d702cb9e89
|
@ -1460,7 +1460,8 @@ static int maintenance_register(void)
|
||||||
git_config_set("maintenance.strategy", "incremental");
|
git_config_set("maintenance.strategy", "incremental");
|
||||||
|
|
||||||
config_get.git_cmd = 1;
|
config_get.git_cmd = 1;
|
||||||
strvec_pushl(&config_get.args, "config", "--global", "--get", "maintenance.repo",
|
strvec_pushl(&config_get.args, "config", "--global", "--get",
|
||||||
|
"--fixed-value", "maintenance.repo",
|
||||||
the_repository->worktree ? the_repository->worktree
|
the_repository->worktree ? the_repository->worktree
|
||||||
: the_repository->gitdir,
|
: the_repository->gitdir,
|
||||||
NULL);
|
NULL);
|
||||||
|
@ -1491,7 +1492,7 @@ static int maintenance_unregister(void)
|
||||||
|
|
||||||
config_unset.git_cmd = 1;
|
config_unset.git_cmd = 1;
|
||||||
strvec_pushl(&config_unset.args, "config", "--global", "--unset",
|
strvec_pushl(&config_unset.args, "config", "--global", "--unset",
|
||||||
"maintenance.repo",
|
"--fixed-value", "maintenance.repo",
|
||||||
the_repository->worktree ? the_repository->worktree
|
the_repository->worktree ? the_repository->worktree
|
||||||
: the_repository->gitdir,
|
: the_repository->gitdir,
|
||||||
NULL);
|
NULL);
|
||||||
|
|
|
@ -404,6 +404,18 @@ test_expect_success 'register and unregister' '
|
||||||
test_cmp before actual
|
test_cmp before actual
|
||||||
'
|
'
|
||||||
|
|
||||||
|
test_expect_success !MINGW 'register and unregister with regex metacharacters' '
|
||||||
|
META="a+b*c" &&
|
||||||
|
git init "$META" &&
|
||||||
|
git -C "$META" maintenance register &&
|
||||||
|
git config --get-all --show-origin maintenance.repo &&
|
||||||
|
git config --get-all --global --fixed-value \
|
||||||
|
maintenance.repo "$(pwd)/$META" &&
|
||||||
|
git -C "$META" maintenance unregister &&
|
||||||
|
test_must_fail git config --get-all --global --fixed-value \
|
||||||
|
maintenance.repo "$(pwd)/$META"
|
||||||
|
'
|
||||||
|
|
||||||
test_expect_success 'start from empty cron table' '
|
test_expect_success 'start from empty cron table' '
|
||||||
GIT_TEST_CRONTAB="test-tool crontab cron.txt" git maintenance start &&
|
GIT_TEST_CRONTAB="test-tool crontab cron.txt" git maintenance start &&
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue