Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorÆvar Arnfjörð Bjarmason <avarab@gmail.com>2017-05-25 22:45:34 +0300
committerJunio C Hamano <gitster@pobox.com>2017-05-26 06:52:37 +0300
commitd1edee4adac8f516f1545d080fbffcdb148ac7b7 (patch)
treea952918e8938571cfb8a059cc453da9e797ba3a5 /t/t7810-grep.sh
parent2e96d8154fc072b4778650560acca31a79ef86b0 (diff)
grep: given --threads with NO_PTHREADS=YesPlease, warn
Add a warning about missing thread support when grep.threads or --threads is set to a non 0 (default) or 1 (no parallelism) value under NO_PTHREADS=YesPlease. This is for consistency with the index-pack & pack-objects commands, which also take a --threads option & are configurable via pack.threads, and have long warned about the same under NO_PTHREADS=YesPlease. Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t7810-grep.sh')
-rwxr-xr-xt/t7810-grep.sh18
1 files changed, 18 insertions, 0 deletions
diff --git a/t/t7810-grep.sh b/t/t7810-grep.sh
index 561709ef6a..f106387820 100755
--- a/t/t7810-grep.sh
+++ b/t/t7810-grep.sh
@@ -791,6 +791,24 @@ do
"
done
+test_expect_success !PTHREADS,C_LOCALE_OUTPUT 'grep --threads=N or pack.threads=N warns when no pthreads' '
+ git grep --threads=2 Hello hello_world 2>err &&
+ grep ^warning: err >warnings &&
+ test_line_count = 1 warnings &&
+ grep -F "no threads support, ignoring --threads" err &&
+ git -c grep.threads=2 grep Hello hello_world 2>err &&
+ grep ^warning: err >warnings &&
+ test_line_count = 1 warnings &&
+ grep -F "no threads support, ignoring grep.threads" err &&
+ git -c grep.threads=2 grep --threads=4 Hello hello_world 2>err &&
+ grep ^warning: err >warnings &&
+ test_line_count = 2 warnings &&
+ grep -F "no threads support, ignoring --threads" err &&
+ grep -F "no threads support, ignoring grep.threads" err &&
+ git -c grep.threads=0 grep --threads=0 Hello hello_world 2>err &&
+ test_line_count = 0 err
+'
+
test_expect_success 'grep from a subdirectory to search wider area (1)' '
mkdir -p s &&
(