From: Junio C Hamano Date: Fri, 11 Dec 2015 19:14:09 +0000 (-0800) Subject: Merge branch 'jk/test-lint-forbid-when-finished-in-subshell' into maint X-Git-Tag: v2.7.0-rc1~7^2~9 X-Git-Url: https://git.lorimer.id.au/gitweb.git/diff_plain/4cb5488fa6cd1dc3cea253e7d8df6bf9d945653b?hp=-c Merge branch 'jk/test-lint-forbid-when-finished-in-subshell' into maint Because "test_when_finished" in our test framework queues the clean-up tasks to be done in a shell variable, it should not be used inside a subshell. Add a mechanism to allow 'bash' to catch such uses, and fix the ones that were found. * jk/test-lint-forbid-when-finished-in-subshell: test-lib-functions: detect test_when_finished in subshell t7800: don't use test_config in a subshell test-lib-functions: support "test_config -C ..." t5801: don't use test_when_finished in a subshell t7610: don't use test_config in a subshell --- 4cb5488fa6cd1dc3cea253e7d8df6bf9d945653b diff --combined t/t7800-difftool.sh index a771cf77f5,48c6e2bc83..ec8bc8c765 --- a/t/t7800-difftool.sh +++ b/t/t7800-difftool.sh @@@ -492,35 -492,16 +492,35 @@@ test_expect_success PERL 'difftool --no test_expect_success PERL 'difftool properly honors gitlink and core.worktree' ' git submodule add ./. submod/ule && + test_config -C submod/ule diff.tool checktrees && + test_config -C submod/ule difftool.checktrees.cmd '\'' + test -d "$LOCAL" && test -d "$REMOTE" && echo good + '\'' && ( cd submod/ule && - test_config diff.tool checktrees && - test_config difftool.checktrees.cmd '\'' - test -d "$LOCAL" && test -d "$REMOTE" && echo good - '\'' && echo good >expect && git difftool --tool=checktrees --dir-diff HEAD~ >actual && test_cmp expect actual ) ' +test_expect_success PERL,SYMLINKS 'difftool --dir-diff symlinked directories' ' + git init dirlinks && + ( + cd dirlinks && + git config diff.tool checktrees && + git config difftool.checktrees.cmd "echo good" && + mkdir foo && + : >foo/bar && + git add foo/bar && + test_commit symlink-one && + ln -s foo link && + git add link && + test_commit symlink-two && + echo good >expect && + git difftool --tool=checktrees --dir-diff HEAD~ >actual && + test_cmp expect actual + ) +' + test_done