Skip to content

Commit eea253b

Browse files
bk2204gitster
authored andcommitted
t5300: abstract away SHA-1-specific constants
Adjust the test so that it computes variables for object IDs instead of using hard-coded hashes. Signed-off-by: brian m. carlson <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 0b2c4af commit eea253b

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

t/t5300-pack-object.sh

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -466,9 +466,11 @@ test_expect_success !PTHREADS,C_LOCALE_OUTPUT 'pack-objects --threads=N or pack.
466466

467467
test_expect_success \
468468
'fake a SHA1 hash collision' \
469-
'test -f .git/objects/c8/2de19312b6c3695c0c18f70709a6c535682a67 &&
470-
cp -f .git/objects/9d/235ed07cd19811a6ceb342de82f190e49c9f68 \
471-
.git/objects/c8/2de19312b6c3695c0c18f70709a6c535682a67'
469+
'long_a=$(git hash-object a | sed -e "s!^..!&/!") &&
470+
long_b=$(git hash-object b | sed -e "s!^..!&/!") &&
471+
test -f .git/objects/$long_b &&
472+
cp -f .git/objects/$long_a \
473+
.git/objects/$long_b'
472474

473475
test_expect_success \
474476
'make sure index-pack detects the SHA1 collision' \

0 commit comments

Comments
 (0)