summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeff King <peff@peff.net>2015-05-27 05:34:58 -0400
committerJunio C Hamano <gitster@pobox.com>2015-05-27 13:14:29 -0700
commitfa73a582b5e7e01184171dc310c7ee0bd9bb2721 (patch)
tree421f0d4bf131b04d79523e2fbaabbe7b91b33edb
parentaeb6f8b3a2bbfd8b48a967139fbf4581e5345182 (diff)
downloadgit-fa73a582b5e7e01184171dc310c7ee0bd9bb2721.tar.gz
t7063: hide stderr from setup inside prereq
When t7063 starts, it runs "update-index --untracked-cache" to see if we support the untracked cache. Its output goes straight to stderr, even if the test is not run with "-v". Let's wrap it in a prereq that will hide the output by default, but show it with "-v". Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
-rwxr-xr-xt/t7063-status-untracked-cache.sh8
1 files changed, 6 insertions, 2 deletions
diff --git a/t/t7063-status-untracked-cache.sh b/t/t7063-status-untracked-cache.sh
index 2b2ffd7d6b..bd4806c12a 100755
--- a/t/t7063-status-untracked-cache.sh
+++ b/t/t7063-status-untracked-cache.sh
@@ -8,10 +8,14 @@ avoid_racy() {
sleep 1
}
-git update-index --untracked-cache
# It's fine if git update-index returns an error code other than one,
# it'll be caught in the first test.
-if test $? -eq 1; then
+test_lazy_prereq UNTRACKED_CACHE '
+ { git update-index --untracked-cache; ret=$?; } &&
+ test $ret -ne 1
+'
+
+if ! test_have_prereq UNTRACKED_CACHE; then
skip_all='This system does not support untracked cache'
test_done
fi