From 838f2bc58ebf0eec20cd61cbae36452c878d448e Mon Sep 17 00:00:00 2001 From: Michael Ernst Date: Mon, 12 Jan 2026 18:16:58 -0800 Subject: [PATCH] Don't clean if there is an error --- tests/git-clone-related-test/test-git-clone-related.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tests/git-clone-related-test/test-git-clone-related.sh b/tests/git-clone-related-test/test-git-clone-related.sh index c0c9d4d..7cd61ce 100755 --- a/tests/git-clone-related-test/test-git-clone-related.sh +++ b/tests/git-clone-related-test/test-git-clone-related.sh @@ -43,8 +43,6 @@ clonedrepo=$(git -C "$resultdir" config --get remote.origin.url) # git 2.22 and later has `git branch --show-current`; CircleCI doesn't have that version yet. clonedbranch=$(git -C "$resultdir" rev-parse --abbrev-ref HEAD) -rm -rf "$startdir" "$resultdir" - if [ "$clonedrepo" != "$GOAL_REPO" ]; then echo "error: test-git-clone-related.sh \"$1\" \"$2\" \"$3\" \"$4\" \"$5\"" echo "error: expected repo $GOAL_REPO, got: $clonedrepo" @@ -55,3 +53,6 @@ if [ "$clonedbranch" != "$GOAL_BRANCH" ]; then echo "error: expected branch $GOAL_BRANCH, got: $clonedbranch" exit 2 fi + +# This comes after the failure exits, so we don't clean up if the test fails. +rm -rf "$startdir" "$resultdir"