summaryrefslogtreecommitdiff
path: root/t/t5537-fetch-shallow.sh
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2018-06-15 18:13:39 (GMT)
committerJunio C Hamano <gitster@pobox.com>2018-06-15 18:20:08 (GMT)
commit037714252f74ae77e816018e43b2504a1b057246 (patch)
treeb50cad99709711c60d673be889481447226930e3 /t/t5537-fetch-shallow.sh
parentfc54c1af3ec09bab8b8ea09768c2da4069b7f53e (diff)
downloadgit-037714252f74ae77e816018e43b2504a1b057246.zip
git-037714252f74ae77e816018e43b2504a1b057246.tar.gz
git-037714252f74ae77e816018e43b2504a1b057246.tar.bz2
tests: clean after SANITY tests
Some of our tests try to make sure Git behaves sensibly in a read-only directory, by dropping 'w' permission bit before doing a test and then restoring it after it is done. The latter is needed for the test framework to clean after itself without leaving a leftover directory that cannot be removed. Ancient parts of tests however arrange the above with chmod a-w . && ... do the test ... status=$? chmod 775 . (exit $status) which obviously would not work if the test somehow dies before it has the chance to do "chmod 775". Rewrite them by following a more robust pattern recently written tests use, which is test_when_finished "chmod 775 ." && chmod a-w . && ... do the test ... Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t5537-fetch-shallow.sh')
-rwxr-xr-xt/t5537-fetch-shallow.sh2
1 files changed, 1 insertions, 1 deletions
diff --git a/t/t5537-fetch-shallow.sh b/t/t5537-fetch-shallow.sh
index df8d2f0..943231a 100755
--- a/t/t5537-fetch-shallow.sh
+++ b/t/t5537-fetch-shallow.sh
@@ -175,8 +175,8 @@ EOF
test_expect_success POSIXPERM,SANITY 'shallow fetch from a read-only repo' '
cp -R .git read-only.git &&
- find read-only.git -print | xargs chmod -w &&
test_when_finished "find read-only.git -type d -print | xargs chmod +w" &&
+ find read-only.git -print | xargs chmod -w &&
git clone --no-local --depth=2 read-only.git from-read-only &&
git --git-dir=from-read-only/.git log --format=%s >actual &&
cat >expect <<EOF &&