@@ -186,7 +186,7 @@ test_expect_success 'no changes are a nop' '
186
186
git checkout branch2 &&
187
187
git rebase -i F &&
188
188
test "$(git symbolic-ref -q HEAD)" = "refs/heads/branch2" &&
189
- test $(git rev-parse I) = $(git rev-parse HEAD)
189
+ test_cmp_rev I HEAD
190
190
'
191
191
192
192
test_expect_success ' test the [branch] option' '
@@ -195,16 +195,16 @@ test_expect_success 'test the [branch] option' '
195
195
git commit -m "stop here" &&
196
196
git rebase -i F branch2 &&
197
197
test "$(git symbolic-ref -q HEAD)" = "refs/heads/branch2" &&
198
- test $(git rev-parse I) = $(git rev-parse branch2) &&
199
- test $(git rev-parse I) = $(git rev-parse HEAD)
198
+ test_cmp_rev I branch2 &&
199
+ test_cmp_rev I HEAD
200
200
'
201
201
202
202
test_expect_success ' test --onto <branch>' '
203
203
git checkout -b test-onto branch2 &&
204
204
git rebase -i --onto branch1 F &&
205
205
test "$(git symbolic-ref -q HEAD)" = "refs/heads/test-onto" &&
206
- test $(git rev-parse HEAD^) = $(git rev-parse branch1) &&
207
- test $(git rev-parse I) = $(git rev-parse branch2)
206
+ test_cmp_rev HEAD^ branch1 &&
207
+ test_cmp_rev I branch2
208
208
'
209
209
210
210
test_expect_success ' rebase on top of a non-conflicting commit' '
@@ -213,12 +213,12 @@ test_expect_success 'rebase on top of a non-conflicting commit' '
213
213
git rebase -i branch2 &&
214
214
test file6 = $(git diff --name-only original-branch1) &&
215
215
test "$(git symbolic-ref -q HEAD)" = "refs/heads/branch1" &&
216
- test $(git rev-parse I) = $(git rev-parse branch2) &&
217
- test $(git rev-parse I) = $(git rev-parse HEAD~2)
216
+ test_cmp_rev I branch2 &&
217
+ test_cmp_rev I HEAD~2
218
218
'
219
219
220
220
test_expect_success ' reflog for the branch shows state before rebase' '
221
- test $(git rev-parse branch1@{1}) = $(git rev-parse original-branch1)
221
+ test_cmp_rev branch1@{1} original-branch1
222
222
'
223
223
224
224
test_expect_success ' reflog for the branch shows correct finish message' '
@@ -278,7 +278,7 @@ test_expect_success 'show conflicted patch' '
278
278
279
279
test_expect_success ' abort' '
280
280
git rebase --abort &&
281
- test $(git rev-parse new-branch1) = $(git rev-parse HEAD) &&
281
+ test_cmp_rev new-branch1 HEAD &&
282
282
test "$(git symbolic-ref -q HEAD)" = "refs/heads/branch1" &&
283
283
test_path_is_missing .git/rebase-merge
284
284
'
@@ -321,7 +321,7 @@ test_expect_success 'retain authorship w/ conflicts' '
321
321
echo resolved >conflict &&
322
322
git add conflict &&
323
323
git rebase --continue &&
324
- test $(git rev-parse conflict-a^0) = $(git rev-parse HEAD^) &&
324
+ test_cmp_rev conflict-a^0 HEAD^ &&
325
325
git show >out &&
326
326
grep AttributeMe out
327
327
'
@@ -338,7 +338,7 @@ test_expect_success 'squash' '
338
338
git rebase -i --onto master HEAD~2
339
339
) &&
340
340
test B = $(cat file7) &&
341
- test $(git rev-parse HEAD^) = $(git rev-parse master)
341
+ test_cmp_rev HEAD^ master
342
342
'
343
343
344
344
test_expect_success ' retain authorship when squashing' '
@@ -397,9 +397,9 @@ test_expect_success REBASE_P 'preserve merges with -p' '
397
397
git update-index --refresh &&
398
398
git diff-files --quiet &&
399
399
git diff-index --quiet --cached HEAD -- &&
400
- test $(git rev-parse HEAD~6) = $(git rev-parse branch1) &&
401
- test $(git rev-parse HEAD~4^2) = $(git rev-parse to-be-preserved) &&
402
- test $(git rev-parse HEAD^^2^) = $(git rev-parse HEAD^^^) &&
400
+ test_cmp_rev HEAD~6 branch1 &&
401
+ test_cmp_rev HEAD~4^2 to-be-preserved &&
402
+ test_cmp_rev HEAD^^2^ HEAD^^^ &&
403
403
test $(git show HEAD~5:file1) = B &&
404
404
test $(git show HEAD~3:file1) = C &&
405
405
test $(git show HEAD:file1) = E &&
@@ -431,7 +431,7 @@ test_expect_success '--continue tries to commit' '
431
431
git add file1 &&
432
432
FAKE_COMMIT_MESSAGE="chouette!" git rebase --continue
433
433
) &&
434
- test $(git rev-parse HEAD^) = $(git rev-parse new-branch1) &&
434
+ test_cmp_rev HEAD^ new-branch1 &&
435
435
git show HEAD | grep chouette
436
436
'
437
437
@@ -738,7 +738,7 @@ test_expect_success 'do "noop" when there is nothing to cherry-pick' '
738
738
--author="Somebody else <[email protected] >" &&
739
739
test $(git rev-parse branch3) != $(git rev-parse branch4) &&
740
740
git rebase -i branch3 &&
741
- test $(git rev-parse branch3) = $(git rev-parse branch4)
741
+ test_cmp_rev branch3 branch4
742
742
743
743
'
744
744
@@ -797,7 +797,7 @@ test_expect_success 'rebase -i continue with unstaged submodule' '
797
797
test_must_fail git rebase -i submodule-base &&
798
798
git reset &&
799
799
git rebase --continue &&
800
- test $(git rev-parse submodule-base) = $(git rev-parse HEAD)
800
+ test_cmp_rev submodule-base HEAD
801
801
'
802
802
803
803
test_expect_success ' avoid unnecessary reset' '
@@ -820,7 +820,7 @@ test_expect_success 'reword' '
820
820
git rebase -i A &&
821
821
git show HEAD | grep "E changed" &&
822
822
test $(git rev-parse master) != $(git rev-parse HEAD) &&
823
- test $(git rev-parse master^) = $(git rev-parse HEAD^) &&
823
+ test_cmp_rev master^ HEAD^ &&
824
824
FAKE_LINES="1 2 reword 3 4" FAKE_COMMIT_MESSAGE="D changed" \
825
825
git rebase -i A &&
826
826
git show HEAD^ | grep "D changed" &&
@@ -884,7 +884,7 @@ test_expect_success 'always cherry-pick with --no-ff' '
884
884
git diff HEAD~$p original-no-ff-branch~$p > out &&
885
885
test_must_be_empty out
886
886
done &&
887
- test $(git rev-parse HEAD~3) = $(git rev-parse original-no-ff-branch~3) &&
887
+ test_cmp_rev HEAD~3 original-no-ff-branch~3 &&
888
888
git diff HEAD~3 original-no-ff-branch~3 > out &&
889
889
test_must_be_empty out
890
890
'
0 commit comments