@@ -351,82 +351,6 @@ test_expect_success 'retain authorship when squashing' '
351
351
git show HEAD | grep "^Author: Twerp Snog"
352
352
'
353
353
354
- test_expect_success REBASE_P ' -p handles "no changes" gracefully' '
355
- HEAD=$(git rev-parse HEAD) &&
356
- git rebase -i -p HEAD^ &&
357
- git update-index --refresh &&
358
- git diff-files --quiet &&
359
- git diff-index --quiet --cached HEAD -- &&
360
- test $HEAD = $(git rev-parse HEAD)
361
- '
362
-
363
- test_expect_failure REBASE_P ' exchange two commits with -p' '
364
- git checkout H &&
365
- (
366
- set_fake_editor &&
367
- FAKE_LINES="2 1" git rebase -i -p HEAD~2
368
- ) &&
369
- test H = $(git cat-file commit HEAD^ | sed -ne \$p) &&
370
- test G = $(git cat-file commit HEAD | sed -ne \$p)
371
- '
372
-
373
- test_expect_success REBASE_P ' preserve merges with -p' '
374
- git checkout -b to-be-preserved primary^ &&
375
- : > unrelated-file &&
376
- git add unrelated-file &&
377
- test_tick &&
378
- git commit -m "unrelated" &&
379
- git checkout -b another-branch primary &&
380
- echo B > file1 &&
381
- test_tick &&
382
- git commit -m J file1 &&
383
- test_tick &&
384
- git merge to-be-preserved &&
385
- echo C > file1 &&
386
- test_tick &&
387
- git commit -m K file1 &&
388
- echo D > file1 &&
389
- test_tick &&
390
- git commit -m L1 file1 &&
391
- git checkout HEAD^ &&
392
- echo 1 > unrelated-file &&
393
- test_tick &&
394
- git commit -m L2 unrelated-file &&
395
- test_tick &&
396
- git merge another-branch &&
397
- echo E > file1 &&
398
- test_tick &&
399
- git commit -m M file1 &&
400
- git checkout -b to-be-rebased &&
401
- test_tick &&
402
- git rebase -i -p --onto branch1 primary &&
403
- git update-index --refresh &&
404
- git diff-files --quiet &&
405
- git diff-index --quiet --cached HEAD -- &&
406
- test_cmp_rev HEAD~6 branch1 &&
407
- test_cmp_rev HEAD~4^2 to-be-preserved &&
408
- test_cmp_rev HEAD^^2^ HEAD^^^ &&
409
- test $(git show HEAD~5:file1) = B &&
410
- test $(git show HEAD~3:file1) = C &&
411
- test $(git show HEAD:file1) = E &&
412
- test $(git show HEAD:unrelated-file) = 1
413
- '
414
-
415
- test_expect_success REBASE_P ' edit ancestor with -p' '
416
- (
417
- set_fake_editor &&
418
- FAKE_LINES="1 2 edit 3 4" git rebase -i -p HEAD~3
419
- ) &&
420
- echo 2 > unrelated-file &&
421
- test_tick &&
422
- git commit -m L2-modified --amend unrelated-file &&
423
- git rebase --continue &&
424
- git update-index --refresh &&
425
- git diff-files --quiet &&
426
- git diff-index --quiet --cached HEAD -- &&
427
- test $(git show HEAD:unrelated-file) = 2
428
- '
429
-
430
354
test_expect_success ' --continue tries to commit' '
431
355
git reset --hard D &&
432
356
test_tick &&
0 commit comments