diff options
-rwxr-xr-x | git-rebase.sh | 1 | ||||
-rwxr-xr-x | t/t3420-rebase-autostash.sh | 11 |
2 files changed, 12 insertions, 0 deletions
diff --git a/git-rebase.sh b/git-rebase.sh index 154d4be0a4..2d5c2bd0fc 100755 --- a/git-rebase.sh +++ b/git-rebase.sh @@ -547,6 +547,7 @@ then # Lazily switch to the target branch if needed... test -z "$switch_to" || git checkout "$switch_to" -- say "$(eval_gettext "Current branch \$branch_name is up to date.")" + finish_rebase exit 0 else say "$(eval_gettext "Current branch \$branch_name is up to date, rebase forced.")" diff --git a/t/t3420-rebase-autostash.sh b/t/t3420-rebase-autostash.sh index 1bde007160..90eb26493c 100755 --- a/t/t3420-rebase-autostash.sh +++ b/t/t3420-rebase-autostash.sh @@ -152,6 +152,17 @@ test_expect_success "rebase: fast-forward rebase" ' git checkout feature-branch ' +test_expect_success "rebase: noop rebase" ' + test_config rebase.autostash true && + git reset --hard && + git checkout -b same-feature-branch feature-branch && + test_when_finished git branch -D same-feature-branch && + echo dirty >>file1 && + git rebase feature-branch && + grep dirty file1 && + git checkout feature-branch +' + testrebase "" .git/rebase-apply testrebase " --merge" .git/rebase-merge testrebase " --interactive" .git/rebase-merge |