summaryrefslogtreecommitdiff
path: root/t/t7610-mergetool.sh
diff options
context:
space:
mode:
authorJeff King <peff@peff.net>2016-11-27 06:34:45 (GMT)
committerJunio C Hamano <gitster@pobox.com>2016-11-29 19:00:38 (GMT)
commitfa3142c9193bb31e7154d0f0cd7d15208a8dd51a (patch)
tree3c283a2df4c0f19169b684c2d8815a7142b7aef8 /t/t7610-mergetool.sh
parentc578a09bd6310157ea69bb1d2ec2d3d2cc58c85a (diff)
downloadgit-fa3142c9193bb31e7154d0f0cd7d15208a8dd51a.zip
git-fa3142c9193bb31e7154d0f0cd7d15208a8dd51a.tar.gz
git-fa3142c9193bb31e7154d0f0cd7d15208a8dd51a.tar.bz2
t7610: clean up foo.XXXXXX tmpdir
The lazy prereq for MKTEMP uses "mktemp -t" to see if mergetool's internal mktemp call will be able to run. But unlike the call inside mergetool, we do not ever bother to clean up the result, and the /tmp of git developers will slowly fill up with "foo.XXXXXX" directories as they run the test suite over and over. Let's clean up the directory after we've verified its creation. Note that we don't use test_when_finished here, and instead just make rmdir part of the &&-chain. We should only remove something that we're confident we just created. A failure in the middle of the chain either means there's nothing to clean up, or we are very confused and should err on the side of caution. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t7610-mergetool.sh')
-rwxr-xr-xt/t7610-mergetool.sh3
1 files changed, 2 insertions, 1 deletions
diff --git a/t/t7610-mergetool.sh b/t/t7610-mergetool.sh
index 7217f39..4db24d5 100755
--- a/t/t7610-mergetool.sh
+++ b/t/t7610-mergetool.sh
@@ -591,7 +591,8 @@ test_expect_success 'filenames seen by tools start with ./' '
test_lazy_prereq MKTEMP '
tempdir=$(mktemp -d -t foo.XXXXXX) &&
- test -d "$tempdir"
+ test -d "$tempdir" &&
+ rmdir "$tempdir"
'
test_expect_success MKTEMP 'temporary filenames are used with mergetool.writeToTemp' '