From a3c45d126012e01b23edc4923ffddffac61d703b Mon Sep 17 00:00:00 2001 From: Jeff King Date: Thu, 15 Dec 2016 21:31:59 -0500 Subject: t: use nongit() function where applicable Many tests want to run a command outside of any git repo; with the nongit() function this is now a one-liner. It saves a few lines, but more importantly, it's immediately obvious what the code is trying to accomplish. This doesn't convert every such case in the test suite; it just covers those that want to do a one-off command. Other cases, such as the ones in t4035, are part of a larger scheme of outside-repo files, and it's less confusing for them to stay consistent with the surrounding tests. Signed-off-by: Jeff King Signed-off-by: Junio C Hamano --- t/t9902-completion.sh | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) (limited to 't/t9902-completion.sh') diff --git a/t/t9902-completion.sh b/t/t9902-completion.sh index 2ba62fbc17..a34e55f874 100755 --- a/t/t9902-completion.sh +++ b/t/t9902-completion.sh @@ -257,12 +257,7 @@ test_expect_success SYMLINKS '__gitdir - resulting path avoids symlinks' ' ' test_expect_success '__gitdir - not a git repository' ' - ( - cd subdir/subsubdir && - GIT_CEILING_DIRECTORIES="$TRASH_DIRECTORY" && - export GIT_CEILING_DIRECTORIES && - test_must_fail __gitdir - ) + nongit test_must_fail __gitdir ' test_expect_success '__gitcomp - trailing space - options' ' -- cgit v1.2.1