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 <sandals@crustytoothpaste.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>

brian m. carlson committed Jun 28, 2019 at 22:59 UTC f6c9b474a96edbcacecdc61b3e457027332d8921
1 file changed +4 -2
t/t2203-add-intent.sh
+4 -2
@@ -247,12 +247,14 @@ test_expect_success 'diff-files/diff-cached shows ita as new/not-new files' '
247 test_expect_success '"diff HEAD" includes ita as new files' '
248 git reset --hard &&
249 echo new >new-ita &&
250 + oid=$(git hash-object new-ita) &&
251 + oid=$(git rev-parse --short $oid) &&
252 git add -N new-ita &&
253 git diff HEAD >actual &&
252 - cat >expected <<-\EOF &&
254 + cat >expected <<-EOF &&
255 diff --git a/new-ita b/new-ita
256 new file mode 100644
255 - index 0000000..3e75765
257 + index 0000000..$oid
258 --- /dev/null
259 +++ b/new-ita
260 @@ -0,0 +1 @@