summaryrefslogtreecommitdiff
path: root/builtin/pack-objects.c
diff options
context:
space:
mode:
authorÆvar Arnfjörð Bjarmason <avarab@gmail.com>2017-05-25 19:45:33 (GMT)
committerJunio C Hamano <gitster@pobox.com>2017-05-26 03:52:37 (GMT)
commit2e96d8154fc072b4778650560acca31a79ef86b0 (patch)
tree06ba84537afd5b9287f345e57c967bf9fca018f0 /builtin/pack-objects.c
parent967a3eaf432db124cabaa4595677063d5b931ff8 (diff)
downloadgit-2e96d8154fc072b4778650560acca31a79ef86b0.zip
git-2e96d8154fc072b4778650560acca31a79ef86b0.tar.gz
git-2e96d8154fc072b4778650560acca31a79ef86b0.tar.bz2
pack-objects: fix buggy warning about threads
Fix a buggy warning about threads under NO_PTHREADS=YesPlease. Due to re-using the delta_search_threads variable for both the state of the "pack.threads" config & the --threads option, setting "pack.threads" but not supplying --threads would trigger the warning for both "pack.threads" & --threads. Solve this bug by resetting the delta_search_threads variable in git_pack_config(), it might then be set by --threads again and be subsequently warned about, as the test I'm changing here asserts. Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin/pack-objects.c')
-rw-r--r--builtin/pack-objects.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/builtin/pack-objects.c b/builtin/pack-objects.c
index 0fe35d1..f1baf05 100644
--- a/builtin/pack-objects.c
+++ b/builtin/pack-objects.c
@@ -2472,8 +2472,10 @@ static int git_pack_config(const char *k, const char *v, void *cb)
die("invalid number of threads specified (%d)",
delta_search_threads);
#ifdef NO_PTHREADS
- if (delta_search_threads != 1)
+ if (delta_search_threads != 1) {
warning("no threads support, ignoring %s", k);
+ delta_search_threads = 0;
+ }
#endif
return 0;
}