remote: rename 'new' variables
[gitweb.git] / t / t5300-pack-object.sh
index 43a672c3451146f800852a6d8688c10e497b47cf..9c68b992511b7098df0570ca37e0add468a8a093 100755 (executable)
@@ -421,6 +421,42 @@ test_expect_success 'index-pack <pack> works in non-repo' '
        test_path_is_file foo.idx
 '
 
+test_expect_success !PTHREADS,C_LOCALE_OUTPUT 'index-pack --threads=N or pack.threads=N warns when no pthreads' '
+       test_must_fail git index-pack --threads=2 2>err &&
+       grep ^warning: err >warnings &&
+       test_line_count = 1 warnings &&
+       grep -F "no threads support, ignoring --threads=2" err &&
+
+       test_must_fail git -c pack.threads=2 index-pack 2>err &&
+       grep ^warning: err >warnings &&
+       test_line_count = 1 warnings &&
+       grep -F "no threads support, ignoring pack.threads" err &&
+
+       test_must_fail git -c pack.threads=2 index-pack --threads=4 2>err &&
+       grep ^warning: err >warnings &&
+       test_line_count = 2 warnings &&
+       grep -F "no threads support, ignoring --threads=4" err &&
+       grep -F "no threads support, ignoring pack.threads" err
+'
+
+test_expect_success !PTHREADS,C_LOCALE_OUTPUT 'pack-objects --threads=N or pack.threads=N warns when no pthreads' '
+       git pack-objects --threads=2 --stdout --all </dev/null >/dev/null 2>err &&
+       grep ^warning: err >warnings &&
+       test_line_count = 1 warnings &&
+       grep -F "no threads support, ignoring --threads" err &&
+
+       git -c pack.threads=2 pack-objects --stdout --all </dev/null >/dev/null 2>err &&
+       grep ^warning: err >warnings &&
+       test_line_count = 1 warnings &&
+       grep -F "no threads support, ignoring pack.threads" err &&
+
+       git -c pack.threads=2 pack-objects --threads=4 --stdout --all </dev/null >/dev/null 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 pack.threads" err
+'
+
 #
 # WARNING!
 #