Skip to content

Commit b0d3c42

Browse files
bk2204gitster
authored andcommitted
t0090: make test pass with SHA-256
One assertion of this test checks for a shrinking cache tree. The initial index contains a cache tree with two directory names but no object ID, and the second index contains a cache tree with an object ID but no directory name. With SHA-1, the second index is smaller than the first, because the directory information stored takes more than the 20 bytes of an SHA-1 hash, but with SHA-256, the hash is longer, and the test fails the assertion that the second index is smaller than the first. To address this issue, increase the length of the subdirectory name to ensure that the cache tree does indeed shrink in size regardless of the algorithm in use. Signed-off-by: brian m. carlson <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 4772b33 commit b0d3c42

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

t/t0090-cache-tree.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -162,8 +162,8 @@ test_expect_success PERL 'commit --interactive gives cache-tree on partial commi
162162
'
163163

164164
test_expect_success PERL 'commit -p with shrinking cache-tree' '
165-
mkdir -p deep/subdir &&
166-
echo content >deep/subdir/file &&
165+
mkdir -p deep/very-long-subdir &&
166+
echo content >deep/very-long-subdir/file &&
167167
git add deep &&
168168
git commit -m add &&
169169
git rm -r deep &&

0 commit comments

Comments
 (0)