File tree Expand file tree Collapse file tree 6 files changed +23
-11
lines changed
Expand file tree Collapse file tree 6 files changed +23
-11
lines changed Original file line number Diff line number Diff line change @@ -710,8 +710,9 @@ test_expect_success 'expire respects .keep files' '
710710 PACKA=$(ls .git/objects/pack/a-pack*\.pack | sed s/\.pack\$//) &&
711711 touch $PACKA.keep &&
712712 git multi-pack-index expire &&
713- ls -S .git/objects/pack/a-pack* | grep $PACKA >a-pack-files &&
714- test_line_count = 3 a-pack-files &&
713+ test_path_is_file $PACKA.idx &&
714+ test_path_is_file $PACKA.keep &&
715+ test_path_is_file $PACKA.pack &&
715716 test-tool read-midx .git/objects | grep idx >midx-list &&
716717 test_line_count = 2 midx-list
717718 )
Original file line number Diff line number Diff line change 33test_description=' on-disk reverse index'
44. ./test-lib.sh
55
6+ # The below tests want control over the 'pack.writeReverseIndex' setting
7+ # themselves to assert various combinations of it with other options.
8+ sane_unset GIT_TEST_WRITE_REV_INDEX
9+
610packdir=.git/objects/pack
711
812test_expect_success ' setup' '
Original file line number Diff line number Diff line change @@ -329,7 +329,7 @@ test_expect_success SYMLINKS 'clone repo with symlinked or unknown files at obje
329329 for raw in $(ls T*.raw)
330330 do
331331 sed -e "s!/../!/Y/!; s![0-9a-f]\{38,\}!Z!" -e "/commit-graph/d" \
332- -e "/multi-pack-index/d" <$raw >$raw.de-sha-1 &&
332+ -e "/multi-pack-index/d" -e "/rev/d" <$raw >$raw.de-sha-1 &&
333333 sort $raw.de-sha-1 >$raw.de-sha || return 1
334334 done &&
335335
Original file line number Diff line number Diff line change @@ -851,8 +851,10 @@ test_expect_success 'part of packfile response provided as URI' '
851851 test -f h2found &&
852852
853853 # Ensure that there are exactly 6 files (3 .pack and 3 .idx).
854- ls http_child/.git/objects/pack/* >filelist &&
855- test_line_count = 6 filelist
854+ ls http_child/.git/objects/pack/*.pack >packlist &&
855+ ls http_child/.git/objects/pack/*.idx >idxlist &&
856+ test_line_count = 3 idxlist &&
857+ test_line_count = 3 packlist
856858'
857859
858860test_expect_success ' fetching with valid packfile URI but invalid hash fails' '
@@ -905,8 +907,10 @@ test_expect_success 'packfile-uri with transfer.fsckobjects' '
905907 clone "$HTTPD_URL/smart/http_parent" http_child &&
906908
907909 # Ensure that there are exactly 4 files (2 .pack and 2 .idx).
908- ls http_child/.git/objects/pack/* >filelist &&
909- test_line_count = 4 filelist
910+ ls http_child/.git/objects/pack/*.pack >packlist &&
911+ ls http_child/.git/objects/pack/*.idx >idxlist &&
912+ test_line_count = 2 idxlist &&
913+ test_line_count = 2 packlist
910914'
911915
912916test_expect_success ' packfile-uri with transfer.fsckobjects fails on bad object' '
Original file line number Diff line number Diff line change @@ -106,17 +106,17 @@ test_expect_success 'auto gc with too many loose objects does not attempt to cre
106106 test_commit "$(test_oid obj2)" &&
107107 # Our first gc will create a pack; our second will create a second pack
108108 git gc --auto &&
109- ls .git/objects/pack | sort >existing_packs &&
109+ ls .git/objects/pack/pack-*.pack | sort >existing_packs &&
110110 test_commit "$(test_oid obj3)" &&
111111 test_commit "$(test_oid obj4)" &&
112112
113113 git gc --auto 2>err &&
114114 test_i18ngrep ! "^warning:" err &&
115- ls .git/objects/pack/ | sort >post_packs &&
115+ ls .git/objects/pack/pack-*.pack | sort >post_packs &&
116116 comm -1 -3 existing_packs post_packs >new &&
117117 comm -2 -3 existing_packs post_packs >del &&
118118 test_line_count = 0 del && # No packs are deleted
119- test_line_count = 2 new # There is one new pack and its .idx
119+ test_line_count = 1 new # There is one new pack
120120'
121121
122122test_expect_success ' gc --no-quiet' '
Original file line number Diff line number Diff line change @@ -1632,7 +1632,10 @@ test_expect_success 'O: blank lines not necessary after other commands' '
16321632 INPUT_END
16331633
16341634 git fast-import <input &&
1635- test 8 = $(find .git/objects/pack -type f | grep -v multi-pack-index | wc -l) &&
1635+ ls -la .git/objects/pack/pack-*.pack >packlist &&
1636+ ls -la .git/objects/pack/pack-*.pack >idxlist &&
1637+ test_line_count = 4 idxlist &&
1638+ test_line_count = 4 packlist &&
16361639 test $(git rev-parse refs/tags/O3-2nd) = $(git rev-parse O3^) &&
16371640 git log --reverse --pretty=oneline O3 | sed s/^.*z// >actual &&
16381641 test_cmp expect actual
You can’t perform that action at this time.
0 commit comments