Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2018-08-20 22:41:33 +0300
committerJunio C Hamano <gitster@pobox.com>2018-08-20 22:41:33 +0300
commit5a5c5e95653f8db61ca9d1a30159dcf5dc4a8d6a (patch)
tree5e007fc315fb147b9cd06ec40a4a0f67b2f88077 /t/t3430-rebase-merges.sh
parent36fd1e843b83a1ee10178e7da19eee3dee590580 (diff)
parentbc9238bb0910f6d21e021e5c3061bf2124c3a176 (diff)
Merge branch 'pw/rebase-i-merge-segv-fix'
"git rebase -i", when a 'merge <branch>' insn in its todo list fails, segfaulted, which has been (minimally) corrected. * pw/rebase-i-merge-segv-fix: rebase -i: fix SIGSEGV when 'merge <branch>' fails t3430: add conflicting commit
Diffstat (limited to 't/t3430-rebase-merges.sh')
-rwxr-xr-xt/t3430-rebase-merges.sh30
1 files changed, 23 insertions, 7 deletions
diff --git a/t/t3430-rebase-merges.sh b/t/t3430-rebase-merges.sh
index 90ae613e23..aa7bfc88ec 100755
--- a/t/t3430-rebase-merges.sh
+++ b/t/t3430-rebase-merges.sh
@@ -13,8 +13,10 @@ Initial setup:
-- B -- (first)
/ \
A - C - D - E - H (master)
- \ /
- F - G (second)
+ \ \ /
+ \ F - G (second)
+ \
+ Conflicting-G
'
. ./test-lib.sh
. "$TEST_DIRECTORY"/lib-rebase.sh
@@ -49,7 +51,9 @@ test_expect_success 'setup' '
git merge --no-commit G &&
test_tick &&
git commit -m H &&
- git tag -m H H
+ git tag -m H H &&
+ git checkout A &&
+ test_commit conflicting-G G.t
'
test_expect_success 'create completely different structure' '
@@ -72,7 +76,7 @@ test_expect_success 'create completely different structure' '
EOF
test_config sequence.editor \""$PWD"/replace-editor.sh\" &&
test_tick &&
- git rebase -i -r A &&
+ git rebase -i -r A master &&
test_cmp_graph <<-\EOF
* Merge the topic branch '\''onebranch'\''
|\
@@ -125,7 +129,7 @@ test_expect_success '`reset` refuses to overwrite untracked files' '
git rebase --abort
'
-test_expect_success 'failed `merge` writes patch (may be rescheduled, too)' '
+test_expect_success 'failed `merge -C` writes patch (may be rescheduled, too)' '
test_when_finished "test_might_fail git rebase --abort" &&
git checkout -b conflicting-merge A &&
@@ -141,13 +145,25 @@ test_expect_success 'failed `merge` writes patch (may be rescheduled, too)' '
: fail because of merge conflict &&
rm G.t .git/rebase-merge/patch &&
- git reset --hard &&
- test_commit conflicting-G G.t not-G conflicting-G &&
+ git reset --hard conflicting-G &&
test_must_fail git rebase --continue &&
! grep "^merge -C .* G$" .git/rebase-merge/git-rebase-todo &&
test_path_is_file .git/rebase-merge/patch
'
+SQ="'"
+test_expect_success 'failed `merge <branch>` does not crash' '
+ test_when_finished "test_might_fail git rebase --abort" &&
+ git checkout conflicting-G &&
+
+ echo "merge G" >script-from-scratch &&
+ test_config sequence.editor \""$PWD"/replace-editor.sh\" &&
+ test_tick &&
+ test_must_fail git rebase -ir HEAD &&
+ ! grep "^merge G$" .git/rebase-merge/git-rebase-todo &&
+ grep "^Merge branch ${SQ}G${SQ}$" .git/rebase-merge/message
+'
+
test_expect_success 'with a branch tip that was cherry-picked already' '
git checkout -b already-upstream master &&
base="$(git rev-parse --verify HEAD)" &&