Skip to content

Commit 76340c8

Browse files
newrengitster
authored andcommitted
rebase tests: repeat some tests using the merge backend instead of am
In order to ensure the merge/interactive backend gets similar coverage to the am one, add some tests for cases where previously only the am backend was tested. Signed-off-by: Elijah Newren <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 980b482 commit 76340c8

File tree

2 files changed

+26
-4
lines changed

2 files changed

+26
-4
lines changed

t/t5520-pull.sh

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -277,14 +277,27 @@ test_expect_success '--rebase' '
277277
test_cmp expect actual
278278
'
279279

280-
test_expect_success '--rebase fast forward' '
280+
test_expect_success '--rebase (merge) fast forward' '
281281
git reset --hard before-rebase &&
282282
git checkout -b ff &&
283283
echo another modification >file &&
284284
git commit -m third file &&
285285
286286
git checkout to-rebase &&
287-
git pull --rebase . ff &&
287+
git -c rebase.backend=merge pull --rebase . ff &&
288+
test_cmp_rev HEAD ff &&
289+
290+
# The above only validates the result. Did we actually bypass rebase?
291+
git reflog -1 >reflog.actual &&
292+
sed "s/^[0-9a-f][0-9a-f]*/OBJID/" reflog.actual >reflog.fuzzy &&
293+
echo "OBJID HEAD@{0}: pull --rebase . ff: Fast-forward" >reflog.expected &&
294+
test_cmp reflog.expected reflog.fuzzy
295+
'
296+
297+
test_expect_success '--rebase (am) fast forward' '
298+
git reset --hard before-rebase &&
299+
300+
git -c rebase.backend=am pull --rebase . ff &&
288301
test_cmp_rev HEAD ff &&
289302
290303
# The above only validates the result. Did we actually bypass rebase?

t/t6047-diff3-conflict-markers.sh

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -186,15 +186,24 @@ test_expect_success 'check multiple merge bases' '
186186
)
187187
'
188188

189-
test_expect_success 'rebase describes fake ancestor base' '
189+
test_expect_success 'rebase --merge describes parent of commit being picked' '
190190
test_create_repo rebase &&
191191
(
192192
cd rebase &&
193193
test_commit base file &&
194194
test_commit master file &&
195195
git checkout -b side HEAD^ &&
196196
test_commit side file &&
197-
test_must_fail git -c merge.conflictstyle=diff3 rebase master &&
197+
test_must_fail git -c merge.conflictstyle=diff3 rebase --merge master &&
198+
grep "||||||| parent of" file
199+
)
200+
'
201+
202+
test_expect_success 'rebase --am describes fake ancestor base' '
203+
(
204+
cd rebase &&
205+
git rebase --abort &&
206+
test_must_fail git -c merge.conflictstyle=diff3 rebase --am master &&
198207
grep "||||||| constructed merge base" file
199208
)
200209
'

0 commit comments

Comments
 (0)