Skip to content

Commit f6c9b47

Browse files
bk2204gitster
authored andcommitted
t2203: avoid hard-coded object ID values
In order to make this test work with multiple hash algorithms, compute the object ID used in this test instead of hard-coding it. Signed-off-by: brian m. carlson <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent bfefd52 commit f6c9b47

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

t/t2203-add-intent.sh

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -247,12 +247,14 @@ test_expect_success 'diff-files/diff-cached shows ita as new/not-new files' '
247247
test_expect_success '"diff HEAD" includes ita as new files' '
248248
git reset --hard &&
249249
echo new >new-ita &&
250+
oid=$(git hash-object new-ita) &&
251+
oid=$(git rev-parse --short $oid) &&
250252
git add -N new-ita &&
251253
git diff HEAD >actual &&
252-
cat >expected <<-\EOF &&
254+
cat >expected <<-EOF &&
253255
diff --git a/new-ita b/new-ita
254256
new file mode 100644
255-
index 0000000..3e75765
257+
index 0000000..$oid
256258
--- /dev/null
257259
+++ b/new-ita
258260
@@ -0,0 +1 @@

0 commit comments

Comments
 (0)