diff options
author | Johannes Schindelin <johannes.schindelin@gmx.de> | 2022-11-07 21:25:01 +0300 |
---|---|---|
committer | Taylor Blau <me@ttaylorr.com> | 2022-11-07 21:57:13 +0300 |
commit | c90db53d203d7ade1dc7abe63857cfb5616fe34f (patch) | |
tree | 5beebd1554d788ed94a85ffa0d020898370d14c9 /t/t9210-scalar.sh | |
parent | 3b08839926fcc7cc48cf4c759737c1a71af430c1 (diff) |
scalar reconfigure -a: remove stale `scalar.repo` entries
Every once in a while, a Git for Windows installation fails because the
attempt to reconfigure a Scalar enlistment failed because it was deleted
manually without removing the corresponding entries in the global Git
config.
In f5f0842d0b5 (scalar: let 'unregister' handle a deleted enlistment
directory gracefully, 2021-12-03), we already taught `scalar delete` to
handle the case of a manually deleted enlistment gracefully. This patch
adds the same graceful handling to `scalar reconfigure --all`.
This patch is best viewed with `--color-moved`.
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Taylor Blau <me@ttaylorr.com>
Diffstat (limited to 't/t9210-scalar.sh')
-rwxr-xr-x | t/t9210-scalar.sh | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/t/t9210-scalar.sh b/t/t9210-scalar.sh index be51a8bb7a..c7f8a37910 100755 --- a/t/t9210-scalar.sh +++ b/t/t9210-scalar.sh @@ -166,6 +166,17 @@ test_expect_success 'scalar reconfigure' ' test true = "$(git -C one/src config core.preloadIndex)" ' +test_expect_success '`reconfigure -a` removes stale config entries' ' + git init stale/src && + scalar register stale && + scalar list >scalar.repos && + grep stale scalar.repos && + rm -rf stale && + scalar reconfigure -a && + scalar list >scalar.repos && + ! grep stale scalar.repos +' + test_expect_success 'scalar delete without enlistment shows a usage' ' test_expect_code 129 scalar delete ' |