Skip to content

Commit

Permalink
t7201: abstract away SHA-1-specific constants
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
bk2204 authored and gitster committed Jul 30, 2020
1 parent 866be6e commit d482c23
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions t/t7201-co.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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) &&
Expand All @@ -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) &&
Expand Down

0 comments on commit d482c23

Please sign in to comment.