Skip to content

Commit d482c23

Browse files
bk2204gitster
authored andcommitted
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 <[email protected]> Reviewed-by: Eric Sunshine <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 866be6e commit d482c23

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

t/t7201-co.sh

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -230,9 +230,10 @@ test_expect_success 'switch to another branch while carrying a deletion' '
230230
test_expect_success 'checkout to detach HEAD (with advice declined)' '
231231
232232
git config advice.detachedHead false &&
233+
rev=$(git rev-parse --short renamer^) &&
233234
git checkout -f renamer && git clean -f &&
234235
git checkout renamer^ 2>messages &&
235-
test_i18ngrep "HEAD is now at 7329388" messages &&
236+
test_i18ngrep "HEAD is now at $rev" messages &&
236237
test_line_count = 1 messages &&
237238
H=$(git rev-parse --verify HEAD) &&
238239
M=$(git show-ref -s --verify refs/heads/master) &&
@@ -248,9 +249,10 @@ test_expect_success 'checkout to detach HEAD (with advice declined)' '
248249

249250
test_expect_success 'checkout to detach HEAD' '
250251
git config advice.detachedHead true &&
252+
rev=$(git rev-parse --short renamer^) &&
251253
git checkout -f renamer && git clean -f &&
252254
GIT_TEST_GETTEXT_POISON=false git checkout renamer^ 2>messages &&
253-
grep "HEAD is now at 7329388" messages &&
255+
grep "HEAD is now at $rev" messages &&
254256
test_line_count -gt 1 messages &&
255257
H=$(git rev-parse --verify HEAD) &&
256258
M=$(git show-ref -s --verify refs/heads/master) &&

0 commit comments

Comments
 (0)