From 23739aa2b3d2546c3b3ff0e06eb5171b37e31a90 Mon Sep 17 00:00:00 2001 From: Michael Haggerty Date: Mon, 22 May 2017 16:17:31 +0200 Subject: [PATCH] t3600: clean up permissions test properly The test of failing `git rm -f` removes the write permissions on the test directory, but fails to restore them if the test fails. This means that the test temporary directory cannot be cleaned up, which means that subsequent attempts to run the test fail mysteriously. Instead, do the cleanup in a `test_when_finished` block so that it can't be skipped. Signed-off-by: Michael Haggerty Signed-off-by: Junio C Hamano --- t/t3600-rm.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/t/t3600-rm.sh b/t/t3600-rm.sh index 5f9913ba33..f8568f8841 100755 --- a/t/t3600-rm.sh +++ b/t/t3600-rm.sh @@ -97,9 +97,9 @@ test_expect_success FUNNYNAMES \ embedded'" test_expect_success SANITY 'Test that "git rm -f" fails if its rm fails' ' + test_when_finished "chmod 775 ." && chmod a-w . && - test_must_fail git rm -f baz && - chmod 775 . + test_must_fail git rm -f baz ' test_expect_success \ -- 2.11.4.GIT