Skip to content

Commit 375775b

Browse files
ashumkingitster
authored andcommitted
t7102 (reset): don't hardcode SHA-1 in expected outputs
The expected SHA-1 digests are always available in variables. Use them instead of hardcoding. Signed-off-by: Alexey Shumkin <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 77a6815 commit 375775b

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

t/t7102-reset.sh

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,8 @@ test_expect_success \
192192
'changing files and redo the last commit should succeed' '
193193
echo "3rd line 2nd file" >>secondfile &&
194194
git commit -a -C ORIG_HEAD &&
195-
check_changes 3d3b7be011a58ca0c179ae45d94e6c83c0b0cd0d &&
195+
head4=$(git rev-parse --verify HEAD) &&
196+
check_changes $head4 &&
196197
test "$(git rev-parse ORIG_HEAD)" = \
197198
$head5
198199
'
@@ -211,7 +212,7 @@ test_expect_success \
211212
git reset --hard HEAD~2 &&
212213
check_changes ddaefe00f1da16864591c61fdc7adb5d7cd6b74e &&
213214
test "$(git rev-parse ORIG_HEAD)" = \
214-
3d3b7be011a58ca0c179ae45d94e6c83c0b0cd0d
215+
$head4
215216
'
216217

217218
>.diff_expect
@@ -326,10 +327,11 @@ test_expect_success '--hard reset to HEAD should clear a failed merge' '
326327
git checkout branch2 &&
327328
echo "3rd line in branch2" >>secondfile &&
328329
git commit -a -m "change in branch2" &&
330+
head3=$(git rev-parse --verify HEAD) &&
329331
330332
test_must_fail git pull . branch1 &&
331333
git reset --hard &&
332-
check_changes 77abb337073fb4369a7ad69ff6f5ec0e4d6b54bb
334+
check_changes $head3
333335
'
334336

335337
>.diff_expect

0 commit comments

Comments
 (0)