summaryrefslogtreecommitdiff
path: root/t/t3506-cherry-pick-ff.sh
diff options
context:
space:
mode:
authorbrian m. carlson <sandals@crustytoothpaste.net>2019-08-18 19:16:40 (GMT)
committerJunio C Hamano <gitster@pobox.com>2019-08-20 18:09:22 (GMT)
commit19ce5496c2afb6ff247db833659bdad163029d5d (patch)
tree1c99063b1ceff39260e3a708e0f5dfe842b6e3fb /t/t3506-cherry-pick-ff.sh
parent9a6738c061ad89216d6bf0ca9472c9be5dcb8155 (diff)
downloadgit-19ce5496c2afb6ff247db833659bdad163029d5d.zip
git-19ce5496c2afb6ff247db833659bdad163029d5d.tar.gz
git-19ce5496c2afb6ff247db833659bdad163029d5d.tar.bz2
t3506: make hash independent
This test uses a hard-coded object ID to ensure that the result of cherry-pick --ff is correct. Use test_oid to make this work for both SHA-1 and SHA-256. Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t3506-cherry-pick-ff.sh')
-rwxr-xr-xt/t3506-cherry-pick-ff.sh8
1 files changed, 6 insertions, 2 deletions
diff --git a/t/t3506-cherry-pick-ff.sh b/t/t3506-cherry-pick-ff.sh
index 127dd00..9d5adbc 100755
--- a/t/t3506-cherry-pick-ff.sh
+++ b/t/t3506-cherry-pick-ff.sh
@@ -16,7 +16,11 @@ test_expect_success setup '
git add file1 &&
test_tick &&
git commit -m "second" &&
- git tag second
+ git tag second &&
+ test_oid_cache <<-EOF
+ cp_ff sha1:1df192cd8bc58a2b275d842cede4d221ad9000d1
+ cp_ff sha256:e70d6b7fc064bddb516b8d512c9057094b96ce6ff08e12080acc4fe7f1d60a1d
+ EOF
'
test_expect_success 'cherry-pick using --ff fast forwards' '
@@ -102,7 +106,7 @@ test_expect_success 'cherry pick a root commit with --ff' '
git add file2 &&
git commit --amend -m "file2" &&
git cherry-pick --ff first &&
- test "$(git rev-parse --verify HEAD)" = "1df192cd8bc58a2b275d842cede4d221ad9000d1"
+ test "$(git rev-parse --verify HEAD)" = "$(test_oid cp_ff)"
'
test_expect_success 'cherry-pick --ff on unborn branch' '