Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Sunshine <sunshine@sunshineco.com>2022-11-21 06:00:21 +0300
committerJunio C Hamano <gitster@pobox.com>2022-12-09 04:41:59 +0300
commit35c194dc57fc0cfe1381aab2b45d9588766242e1 (patch)
tree99ab19dd7853e052c04a5df407507c8f5ac31212 /t/t1509-root-work-tree.sh
parentce153b8d4d5be93d0960a143d08dcffd55694b0e (diff)
t1509: facilitate repeated script invocations
t1509-root-work-tree.sh, which tests behavior of a Git repository located at the root `/` directory, refuses to run if it detects the presence of an existing repository at `/`. This safeguard ensures that it won't clobber a legitimate repository at that location. However, because t1509 does a poor job of cleaning up after itself, it runs afoul of its own safety check on subsequent runs, which makes it painful to run the script repeatedly since each run requires manual cleanup of detritus from the previous run. Address this shortcoming by making t1509 clean up after itself as its last action. This is safe since the script can only make it to this cleanup action if it did not find a legitimate repository at `/` in the first place, so the resources cleaned up here can only have been created by the script itself. Signed-off-by: Eric Sunshine <sunshine@sunshineco.com>
Diffstat (limited to 't/t1509-root-work-tree.sh')
-rwxr-xr-xt/t1509-root-work-tree.sh5
1 files changed, 5 insertions, 0 deletions
diff --git a/t/t1509-root-work-tree.sh b/t/t1509-root-work-tree.sh
index d041762628..c799f5b6ac 100755
--- a/t/t1509-root-work-tree.sh
+++ b/t/t1509-root-work-tree.sh
@@ -256,4 +256,9 @@ test_expect_success 'go to /foo' 'cd /foo'
test_vars 'auto gitdir, root' "/" "" ""
+test_expect_success 'cleanup root' '
+ rm -rf /.git /refs /objects /info /hooks /branches /foo &&
+ rm -f /HEAD /config /description /expected /ls.expected /me /result
+'
+
test_done