aboutsummaryrefslogtreecommitdiff
path: root/t/t3404-rebase-interactive.sh
diff options
context:
space:
mode:
authorJohannes Schindelin <Johannes.Schindelin@gmx.de>2008-10-10 13:42:12 +0200
committerShawn O. Pearce <spearce@spearce.org>2008-10-10 08:32:03 -0700
commitff74126c03a8dfd04e7533573a5c420f2a7112ac (patch)
treedeb3f4fa7b69bf1574706bbc57c62cd5b984c820 /t/t3404-rebase-interactive.sh
parentb8eecafd888d219633f4c29e8b6a90fc21a46dfd (diff)
downloadgit-ff74126c03a8dfd04e7533573a5c420f2a7112ac.tar.gz
git-ff74126c03a8dfd04e7533573a5c420f2a7112ac.tar.xz
rebase -i: do not fail when there is no commit to cherry-pick
In case there is no commit to apply (for example because you rebase to upstream and all your local patches have been applied there), do not fail. The non-interactive rebase already behaves that way. Do this by introducing a new command, "noop", which is substituted for an empty commit list, so that deleting the commit list can still abort as before. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Diffstat (limited to 't/t3404-rebase-interactive.sh')
-rwxr-xr-xt/t3404-rebase-interactive.sh11
1 files changed, 11 insertions, 0 deletions
diff --git a/t/t3404-rebase-interactive.sh b/t/t3404-rebase-interactive.sh
index e0ded197e..7d10a27f1 100755
--- a/t/t3404-rebase-interactive.sh
+++ b/t/t3404-rebase-interactive.sh
@@ -419,4 +419,15 @@ test_expect_success 'rebase with a file named HEAD in worktree' '
'
+test_expect_success 'do "noop" when there is nothing to cherry-pick' '
+
+ git checkout -b branch4 HEAD &&
+ GIT_EDITOR=: git commit --amend \
+ --author="Somebody else <somebody@else.com>"
+ test $(git rev-parse branch3) != $(git rev-parse branch4) &&
+ git rebase -i branch3 &&
+ test $(git rev-parse branch3) = $(git rev-parse branch4)
+
+'
+
test_done