Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbrian m. carlson <sandals@crustytoothpaste.net>2019-06-29 01:59:28 +0300
committerJunio C Hamano <gitster@pobox.com>2019-07-01 23:28:19 +0300
commitf6c9b474a96edbcacecdc61b3e457027332d8921 (patch)
tree9e5a69ebfad73ed51d196f9ee9b025b03c42a830 /t/t2203-add-intent.sh
parentbfefd5202babaa1ace6b122e9df4959e3ec21e5d (diff)
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>
Diffstat (limited to 't/t2203-add-intent.sh')
-rwxr-xr-xt/t2203-add-intent.sh6
1 files changed, 4 insertions, 2 deletions
diff --git a/t/t2203-add-intent.sh b/t/t2203-add-intent.sh
index 68e54d5c44..5bbe8dcce4 100755
--- a/t/t2203-add-intent.sh
+++ b/t/t2203-add-intent.sh
@@ -247,12 +247,14 @@ test_expect_success 'diff-files/diff-cached shows ita as new/not-new files' '
test_expect_success '"diff HEAD" includes ita as new files' '
git reset --hard &&
echo new >new-ita &&
+ oid=$(git hash-object new-ita) &&
+ oid=$(git rev-parse --short $oid) &&
git add -N new-ita &&
git diff HEAD >actual &&
- cat >expected <<-\EOF &&
+ cat >expected <<-EOF &&
diff --git a/new-ita b/new-ita
new file mode 100644
- index 0000000..3e75765
+ index 0000000..$oid
--- /dev/null
+++ b/new-ita
@@ -0,0 +1 @@