Imported Upstream version 2.17.0
[platform/upstream/git.git] / t / t3400-rebase.sh
index 8ac58d5..72d9564 100755 (executable)
@@ -277,4 +277,38 @@ EOF
        test_cmp From_.msg out
 '
 
+test_expect_success 'rebase--am.sh and --show-current-patch' '
+       test_create_repo conflict-apply &&
+       (
+               cd conflict-apply &&
+               test_commit init &&
+               echo one >>init.t &&
+               git commit -a -m one &&
+               echo two >>init.t &&
+               git commit -a -m two &&
+               git tag two &&
+               test_must_fail git rebase --onto init HEAD^ &&
+               GIT_TRACE=1 git rebase --show-current-patch >/dev/null 2>stderr &&
+               grep "show.*$(git rev-parse two)" stderr
+       )
+'
+
+test_expect_success 'rebase--merge.sh and --show-current-patch' '
+       test_create_repo conflict-merge &&
+       (
+               cd conflict-merge &&
+               test_commit init &&
+               echo one >>init.t &&
+               git commit -a -m one &&
+               echo two >>init.t &&
+               git commit -a -m two &&
+               git tag two &&
+               test_must_fail git rebase --merge --onto init HEAD^ &&
+               git rebase --show-current-patch >actual.patch &&
+               GIT_TRACE=1 git rebase --show-current-patch >/dev/null 2>stderr &&
+               grep "show.*REBASE_HEAD" stderr &&
+               test "$(git rev-parse REBASE_HEAD)" = "$(git rev-parse two)"
+       )
+'
+
 test_done