[PATCH 2/2] pack-objects: Default to zero threads, meaning auto-assign to #cpus

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Additionally, update some tests for which the multi-threaded result
differs from the single-threaded result and the single-threaded
result is expected.

Signed-off-by: Brandon Casey <casey@xxxxxxxxxxxxxxx>
---


Two of the tests in t5300-pack-object.sh failed when multiple
threads were used. My fix was to set --threads=1 for all pack-objects
calls. I didn't look into it any further than that. All other tests
passed.

-brandon


 builtin-pack-objects.c |    2 +-
 t/t5300-pack-object.sh |    8 ++++----
 2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/builtin-pack-objects.c b/builtin-pack-objects.c
index 5c55c11..743de52 100644
--- a/builtin-pack-objects.c
+++ b/builtin-pack-objects.c
@@ -70,7 +70,7 @@ static int progress = 1;
 static int window = 10;
 static uint32_t pack_size_limit, pack_size_limit_cfg;
 static int depth = 50;
-static int delta_search_threads = 1;
+static int delta_search_threads = 0;
 static int pack_to_stdout;
 static int num_preferred_base;
 static struct progress *progress_state;
diff --git a/t/t5300-pack-object.sh b/t/t5300-pack-object.sh
index cd3c149..16ee940 100755
--- a/t/t5300-pack-object.sh
+++ b/t/t5300-pack-object.sh
@@ -35,7 +35,7 @@ test_expect_success \
 
 test_expect_success \
     'pack without delta' \
-    'packname_1=$(git pack-objects --window=0 test-1 <obj-list)'
+    'packname_1=$(git pack-objects --threads=1 --window=0 test-1 <obj-list)'
 
 rm -fr .git2
 mkdir .git2
@@ -66,7 +66,7 @@ cd "$TRASH"
 test_expect_success \
     'pack with REF_DELTA' \
     'pwd &&
-     packname_2=$(git pack-objects test-2 <obj-list)'
+     packname_2=$(git pack-objects --threads=1 test-2 <obj-list)'
 
 rm -fr .git2
 mkdir .git2
@@ -96,7 +96,7 @@ cd "$TRASH"
 test_expect_success \
     'pack with OFS_DELTA' \
     'pwd &&
-     packname_3=$(git pack-objects --delta-base-offset test-3 <obj-list)'
+     packname_3=$(git pack-objects --threads=1 --delta-base-offset test-3 <obj-list)'
 
 rm -fr .git2
 mkdir .git2
@@ -271,7 +271,7 @@ test_expect_success \
 test_expect_success \
     'honor pack.packSizeLimit' \
     'git config pack.packSizeLimit 200 &&
-     packname_4=$(git pack-objects test-4 <obj-list) &&
+     packname_4=$(git pack-objects --threads=1 test-4 <obj-list) &&
      test 3 = $(ls test-4-*.pack | wc -l)'
 
 test_done
-- 
1.5.4.1.40.gdb90

-
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux