summaryrefslogtreecommitdiff
path: root/t/t3404-rebase-interactive.sh
diff options
context:
space:
mode:
authorLibravatar Johannes Schindelin <Johannes.Schindelin@gmx.de>2007-07-08 03:01:29 +0100
committerLibravatar Junio C Hamano <gitster@pobox.com>2007-07-08 18:24:19 -0700
commit18640d991bde7e081fb851cea5114c09472b188f (patch)
tree621b19e73777dd5b72e3cf16c56398ff6ac2c85b /t/t3404-rebase-interactive.sh
parentt7004: Skip tests for signed tags in an old version of gpg. (diff)
downloadtgif-18640d991bde7e081fb851cea5114c09472b188f.tar.xz
rebase -i: handle --continue more like non-interactive rebase
Non-interactive rebase requires the working tree to be clean, but applies what is in the index without requiring the user to do it herself. Imitate that, but (since we are interactive, after all) fire up an editor with the commit message. It also fixes a subtle bug: a forgotten "continue" was removed, which led to an infinite loop when continuing without remaining patches. Both issues noticed by Frank Lichtenheld. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t3404-rebase-interactive.sh')
-rwxr-xr-xt/t3404-rebase-interactive.sh16
1 files changed, 15 insertions, 1 deletions
diff --git a/t/t3404-rebase-interactive.sh b/t/t3404-rebase-interactive.sh
index 883cf29595..c25133699a 100755
--- a/t/t3404-rebase-interactive.sh
+++ b/t/t3404-rebase-interactive.sh
@@ -63,7 +63,10 @@ test_expect_success 'setup' '
cat > fake-editor.sh << EOF
#!/bin/sh
-test "\$1" = .git/COMMIT_EDITMSG && exit
+test "\$1" = .git/COMMIT_EDITMSG && {
+ test -z "\$FAKE_COMMIT_MESSAGE" || echo "\$FAKE_COMMIT_MESSAGE" > "\$1"
+ exit
+}
test -z "\$FAKE_LINES" && exit
grep -v "^#" < "\$1" > "\$1".tmp
rm "\$1"
@@ -181,6 +184,7 @@ test_expect_success 'preserve merges with -p' '
echo C > file1 &&
test_tick &&
git commit -m K file1 &&
+ test_tick &&
git rebase -i -p --onto branch1 master &&
test $(git rev-parse HEAD^^2) = $(git rev-parse to-be-preserved) &&
test $(git rev-parse HEAD~3) = $(git rev-parse branch1) &&
@@ -188,4 +192,14 @@ test_expect_success 'preserve merges with -p' '
test $(git show HEAD~2:file1) = B
'
+test_expect_success '--continue tries to commit' '
+ test_tick &&
+ ! git rebase -i --onto new-branch1 HEAD^ &&
+ echo resolved > file1 &&
+ git add file1 &&
+ FAKE_COMMIT_MESSAGE="chouette!" git rebase --continue &&
+ test $(git rev-parse HEAD^) = $(git rev-parse new-branch1) &&
+ git show HEAD | grep chouette
+'
+
test_done