Skip to content

Commit

Permalink
t7102 (reset): don't hardcode SHA-1 in expected outputs
Browse files Browse the repository at this point in the history
The expected SHA-1 digests are always available in variables. Use
them instead of hardcoding.

Signed-off-by: Alexey Shumkin <Alex.Crezoff@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
  • Loading branch information
Alexey Shumkin authored and Junio C Hamano committed Jun 26, 2013
1 parent 77a6815 commit 375775b
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions t/t7102-reset.sh
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,8 @@ test_expect_success \
'changing files and redo the last commit should succeed' '
echo "3rd line 2nd file" >>secondfile &&
git commit -a -C ORIG_HEAD &&
check_changes 3d3b7be011a58ca0c179ae45d94e6c83c0b0cd0d &&
head4=$(git rev-parse --verify HEAD) &&
check_changes $head4 &&
test "$(git rev-parse ORIG_HEAD)" = \
$head5
'
Expand All @@ -211,7 +212,7 @@ test_expect_success \
git reset --hard HEAD~2 &&
check_changes ddaefe00f1da16864591c61fdc7adb5d7cd6b74e &&
test "$(git rev-parse ORIG_HEAD)" = \
3d3b7be011a58ca0c179ae45d94e6c83c0b0cd0d
$head4
'

>.diff_expect
Expand Down Expand Up @@ -326,10 +327,11 @@ test_expect_success '--hard reset to HEAD should clear a failed merge' '
git checkout branch2 &&
echo "3rd line in branch2" >>secondfile &&
git commit -a -m "change in branch2" &&
head3=$(git rev-parse --verify HEAD) &&
test_must_fail git pull . branch1 &&
git reset --hard &&
check_changes 77abb337073fb4369a7ad69ff6f5ec0e4d6b54bb
check_changes $head3
'

>.diff_expect
Expand Down

0 comments on commit 375775b

Please sign in to comment.