summaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorLibravatar brian m. carlson <sandals@crustytoothpaste.net>2020-07-29 23:14:01 +0000
committerLibravatar Junio C Hamano <gitster@pobox.com>2020-07-30 09:16:46 -0700
commitd482c234bfad14f0ebab9164522df1c13bdc69e1 (patch)
treeca9b1d7a17d7525eed97fa545d35d4401d301faf /t
parentt7063: make hash size independent (diff)
downloadtgif-d482c234bfad14f0ebab9164522df1c13bdc69e1.tar.xz
t7201: 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 <sandals@crustytoothpaste.net> Reviewed-by: Eric Sunshine <sunshine@sunshineco.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't')
-rwxr-xr-xt/t7201-co.sh6
1 files changed, 4 insertions, 2 deletions
diff --git a/t/t7201-co.sh b/t/t7201-co.sh
index b696bae5f5..4d62b9b00f 100755
--- a/t/t7201-co.sh
+++ b/t/t7201-co.sh
@@ -230,9 +230,10 @@ test_expect_success 'switch to another branch while carrying a deletion' '
test_expect_success 'checkout to detach HEAD (with advice declined)' '
git config advice.detachedHead false &&
+ rev=$(git rev-parse --short renamer^) &&
git checkout -f renamer && git clean -f &&
git checkout renamer^ 2>messages &&
- test_i18ngrep "HEAD is now at 7329388" messages &&
+ test_i18ngrep "HEAD is now at $rev" messages &&
test_line_count = 1 messages &&
H=$(git rev-parse --verify HEAD) &&
M=$(git show-ref -s --verify refs/heads/master) &&
@@ -248,9 +249,10 @@ test_expect_success 'checkout to detach HEAD (with advice declined)' '
test_expect_success 'checkout to detach HEAD' '
git config advice.detachedHead true &&
+ rev=$(git rev-parse --short renamer^) &&
git checkout -f renamer && git clean -f &&
GIT_TEST_GETTEXT_POISON=false git checkout renamer^ 2>messages &&
- grep "HEAD is now at 7329388" messages &&
+ grep "HEAD is now at $rev" messages &&
test_line_count -gt 1 messages &&
H=$(git rev-parse --verify HEAD) &&
M=$(git show-ref -s --verify refs/heads/master) &&