Skip to content

Commit

Permalink
tests: stop testing git rebase --preserve-merges
Browse files Browse the repository at this point in the history
This backend has been deprecated in favor of `git rebase
--rebase-merges`.

In preparation for dropping it, let's remove all the regression tests
that would need it.

Signed-off-by: Johannes Schindelin <[email protected]>
Reviewed-by: Ævar Arnfjörð Bjarmason <[email protected]>
Signed-off-by: Junio C Hamano <[email protected]>
  • Loading branch information
dscho authored and gitster committed Sep 8, 2021
1 parent ab7c7c2 commit aa4df10
Show file tree
Hide file tree
Showing 17 changed files with 3 additions and 764 deletions.
1 change: 0 additions & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,6 @@ jobs:
shell: bash
env:
NO_SVN_TESTS: 1
GIT_TEST_SKIP_REBASE_P: 1
run: ci/run-test-slice.sh ${{matrix.nr}} 10
- name: ci/print-test-failures.sh
if: failure()
Expand Down
76 changes: 0 additions & 76 deletions t/t3404-rebase-interactive.sh
Original file line number Diff line number Diff line change
Expand Up @@ -351,82 +351,6 @@ test_expect_success 'retain authorship when squashing' '
git show HEAD | grep "^Author: Twerp Snog"
'

test_expect_success REBASE_P '-p handles "no changes" gracefully' '
HEAD=$(git rev-parse HEAD) &&
git rebase -i -p HEAD^ &&
git update-index --refresh &&
git diff-files --quiet &&
git diff-index --quiet --cached HEAD -- &&
test $HEAD = $(git rev-parse HEAD)
'

test_expect_failure REBASE_P 'exchange two commits with -p' '
git checkout H &&
(
set_fake_editor &&
FAKE_LINES="2 1" git rebase -i -p HEAD~2
) &&
test H = $(git cat-file commit HEAD^ | sed -ne \$p) &&
test G = $(git cat-file commit HEAD | sed -ne \$p)
'

test_expect_success REBASE_P 'preserve merges with -p' '
git checkout -b to-be-preserved primary^ &&
: > unrelated-file &&
git add unrelated-file &&
test_tick &&
git commit -m "unrelated" &&
git checkout -b another-branch primary &&
echo B > file1 &&
test_tick &&
git commit -m J file1 &&
test_tick &&
git merge to-be-preserved &&
echo C > file1 &&
test_tick &&
git commit -m K file1 &&
echo D > file1 &&
test_tick &&
git commit -m L1 file1 &&
git checkout HEAD^ &&
echo 1 > unrelated-file &&
test_tick &&
git commit -m L2 unrelated-file &&
test_tick &&
git merge another-branch &&
echo E > file1 &&
test_tick &&
git commit -m M file1 &&
git checkout -b to-be-rebased &&
test_tick &&
git rebase -i -p --onto branch1 primary &&
git update-index --refresh &&
git diff-files --quiet &&
git diff-index --quiet --cached HEAD -- &&
test_cmp_rev HEAD~6 branch1 &&
test_cmp_rev HEAD~4^2 to-be-preserved &&
test_cmp_rev HEAD^^2^ HEAD^^^ &&
test $(git show HEAD~5:file1) = B &&
test $(git show HEAD~3:file1) = C &&
test $(git show HEAD:file1) = E &&
test $(git show HEAD:unrelated-file) = 1
'

test_expect_success REBASE_P 'edit ancestor with -p' '
(
set_fake_editor &&
FAKE_LINES="1 2 edit 3 4" git rebase -i -p HEAD~3
) &&
echo 2 > unrelated-file &&
test_tick &&
git commit -m L2-modified --amend unrelated-file &&
git rebase --continue &&
git update-index --refresh &&
git diff-files --quiet &&
git diff-index --quiet --cached HEAD -- &&
test $(git show HEAD:unrelated-file) = 2
'

test_expect_success '--continue tries to commit' '
git reset --hard D &&
test_tick &&
Expand Down
10 changes: 0 additions & 10 deletions t/t3408-rebase-multi-line.sh
Original file line number Diff line number Diff line change
Expand Up @@ -55,14 +55,4 @@ test_expect_success rebase '
test_cmp expect actual
'
test_expect_success REBASE_P rebasep '
git checkout side-merge &&
git rebase -p side &&
git cat-file commit HEAD | sed -e "1,/^\$/d" >actual &&
git cat-file commit side-merge-original | sed -e "1,/^\$/d" >expect &&
test_cmp expect actual
'

test_done
130 changes: 0 additions & 130 deletions t/t3409-rebase-preserve-merges.sh

This file was deleted.

90 changes: 0 additions & 90 deletions t/t3410-rebase-preserve-dropped-merges.sh

This file was deleted.

Loading

0 comments on commit aa4df10

Please sign in to comment.