@matheusbsbs / matheus-bagliano / commits / 76340c8107
Fork 0

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 <newren@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Elijah Newren committed Feb 15, 2020 at 21:36 UTC 76340c8107ba8e658f9cc76d1d220bac2944d1f1
2 files changed +26 -4
t/t5520-pull.sh
+15 -2
@@ -277,14 +277,27 @@ test_expect_success '--rebase' '
277 test_cmp expect actual
278 '
279
280 -test_expect_success '--rebase fast forward' '
280 +test_expect_success '--rebase (merge) fast forward' '
281 git reset --hard before-rebase &&
282 git checkout -b ff &&
283 echo another modification >file &&
284 git commit -m third file &&
285
286 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 &&
301 test_cmp_rev HEAD ff &&
302
303 # The above only validates the result. Did we actually bypass rebase?
t/t6047-diff3-conflict-markers.sh
+11 -2
@@ -186,7 +186,7 @@ test_expect_success 'check multiple merge bases' '
186 )
187 '
188
189 -test_expect_success 'rebase describes fake ancestor base' '
189 +test_expect_success 'rebase --merge describes parent of commit being picked' '
190 test_create_repo rebase &&
191 (
192 cd rebase &&
@@ -194,7 +194,16 @@ test_expect_success 'rebase describes fake ancestor base' '
194 test_commit master file &&
195 git checkout -b side HEAD^ &&
196 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 &&
207 grep "||||||| constructed merge base" file
208 )
209 '