Imported Upstream version 2.12.1
[platform/upstream/git.git] / t / t3404-rebase-interactive.sh
index 597e94e..e2f18d1 100755 (executable)
@@ -237,6 +237,22 @@ test_expect_success 'retain authorship' '
        git show HEAD | grep "^Author: Twerp Snog"
 '
 
+test_expect_success 'retain authorship w/ conflicts' '
+       git reset --hard twerp &&
+       test_commit a conflict a conflict-a &&
+       git reset --hard twerp &&
+       GIT_AUTHOR_NAME=AttributeMe \
+       test_commit b conflict b conflict-b &&
+       set_fake_editor &&
+       test_must_fail git rebase -i conflict-a &&
+       echo resolved >conflict &&
+       git add conflict &&
+       git rebase --continue &&
+       test $(git rev-parse conflict-a^0) = $(git rev-parse HEAD^) &&
+       git show >out &&
+       grep AttributeMe out
+'
+
 test_expect_success 'squash' '
        git reset --hard twerp &&
        echo B > file7 &&
@@ -976,6 +992,17 @@ test_expect_success 'rebase -i respects core.commentchar' '
        test B = $(git cat-file commit HEAD^ | sed -ne \$p)
 '
 
+test_expect_success 'rebase -i respects core.commentchar=auto' '
+       test_config core.commentchar auto &&
+       write_script copy-edit-script.sh <<-\EOF &&
+       cp "$1" edit-script
+       EOF
+       test_set_editor "$(pwd)/copy-edit-script.sh" &&
+       test_when_finished "git rebase --abort || :" &&
+       git rebase -i HEAD^ &&
+       test -z "$(grep -ve "^#" -e "^\$" -e "^pick" edit-script)"
+'
+
 test_expect_success 'rebase -i, with <onto> and <upstream> specified as :/quuxery' '
        test_when_finished "git branch -D torebase" &&
        git checkout -b torebase branch1 &&
@@ -1195,7 +1222,7 @@ To avoid this message, use "drop" to explicitly remove a commit.
 Use 'git config rebase.missingCommitsCheck' to change the level of warnings.
 The possible behaviours are: ignore, warn, error.
 
-You can fix this with 'git rebase --edit-todo'.
+You can fix this with 'git rebase --edit-todo' and then run 'git rebase --continue'.
 Or you can abort the rebase with 'git rebase --abort'.
 EOF
 
@@ -1219,7 +1246,7 @@ cat >expect <<EOF
 Warning: the command isn't recognized in the following line:
  - badcmd $(git rev-list --oneline -1 master~1)
 
-You can fix this with 'git rebase --edit-todo'.
+You can fix this with 'git rebase --edit-todo' and then run 'git rebase --continue'.
 Or you can abort the rebase with 'git rebase --abort'.
 EOF
 
@@ -1254,7 +1281,7 @@ cat >expect <<EOF
 Warning: the SHA-1 is missing or isn't a commit in the following line:
  - edit XXXXXXX False commit
 
-You can fix this with 'git rebase --edit-todo'.
+You can fix this with 'git rebase --edit-todo' and then run 'git rebase --continue'.
 Or you can abort the rebase with 'git rebase --abort'.
 EOF