Merge branch 'jk/banned-function'
[gitweb.git] / t / t5300-pack-object.sh
index 65ff60f2ee9b4af61f3f2d7d0f889fc4529e2b60..6c620cd5407537e19507bd92a9cd55b2e54001d8 100755 (executable)
@@ -191,7 +191,7 @@ test_expect_success 'survive missing objects/pack directory' '
                mkdir missing-pack &&
                cd missing-pack &&
                git init &&
-               GOP=.git/objects/pack
+               GOP=.git/objects/pack &&
                rm -fr $GOP &&
                git index-pack --stdin --keep=test <../test-3-${packname_3}.pack &&
                test -f $GOP/pack-${packname_3}.pack &&
@@ -421,6 +421,12 @@ test_expect_success 'index-pack <pack> works in non-repo' '
        test_path_is_file foo.idx
 '
 
+test_expect_success 'index-pack --strict <pack> works in non-repo' '
+       rm -f foo.idx &&
+       nongit git index-pack --strict ../foo.pack &&
+       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 &&
@@ -457,6 +463,11 @@ test_expect_success !PTHREADS,C_LOCALE_OUTPUT 'pack-objects --threads=N or pack.
        grep -F "no threads support, ignoring pack.threads" err
 '
 
+test_expect_success 'pack-objects in too-many-packs mode' '
+       GIT_TEST_FULL_IN_PACK_ARRAY=1 git repack -ad &&
+       git fsck
+'
+
 #
 # WARNING!
 #
@@ -466,9 +477,11 @@ test_expect_success !PTHREADS,C_LOCALE_OUTPUT 'pack-objects --threads=N or pack.
 
 test_expect_success \
     'fake a SHA1 hash collision' \
-    'test -f   .git/objects/c8/2de19312b6c3695c0c18f70709a6c535682a67 &&
-     cp -f     .git/objects/9d/235ed07cd19811a6ceb342de82f190e49c9f68 \
-               .git/objects/c8/2de19312b6c3695c0c18f70709a6c535682a67'
+    'long_a=$(git hash-object a | sed -e "s!^..!&/!") &&
+     long_b=$(git hash-object b | sed -e "s!^..!&/!") &&
+     test -f   .git/objects/$long_b &&
+     cp -f     .git/objects/$long_a \
+               .git/objects/$long_b'
 
 test_expect_success \
     'make sure index-pack detects the SHA1 collision' \