summaryrefslogtreecommitdiff
path: root/t/t3407-rebase-abort.sh
diff options
context:
space:
mode:
authorMartin von Zweigbergk <martin.von.zweigbergk@gmail.com>2010-11-21 12:11:21 +0100
committerJunio C Hamano <gitster@pobox.com>2010-11-23 16:23:10 -0800
commit729ec9e23a13a0610a19a24901d0ab5e2bc44a12 (patch)
tree583b1ecb0f83d5e0c10dbc2bfec4cabcf472cb7c /t/t3407-rebase-abort.sh
parent1c7d402b3e1e9d7e50abfbfb18c88bc79be468ea (diff)
downloadgit-729ec9e23a13a0610a19a24901d0ab5e2bc44a12.tar.gz
rebase --abort: do not update branch ref
If a non-interactive rebase of a ref fails at commit X and is aborted by the user, the ref will be updated twice. First to point at X (with the reflog message "rebase finished: $head_name onto $onto"), and then back to $orig_head. It should not be updated at all. Signed-off-by: Martin von Zweigbergk <martin.von.zweigbergk@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t3407-rebase-abort.sh')
-rwxr-xr-xt/t3407-rebase-abort.sh12
1 files changed, 12 insertions, 0 deletions
diff --git a/t/t3407-rebase-abort.sh b/t/t3407-rebase-abort.sh
index fbb3f2e0df..e573dc845b 100755
--- a/t/t3407-rebase-abort.sh
+++ b/t/t3407-rebase-abort.sh
@@ -72,6 +72,18 @@ testrebase() {
test $(git rev-parse to-rebase) = $(git rev-parse pre-rebase) &&
test ! -d "$dotest"
'
+
+ test_expect_success "rebase$type --abort does not update reflog" '
+ cd "$work_dir" &&
+ # Clean up the state from the previous one
+ git reset --hard pre-rebase &&
+ git reflog show to-rebase > reflog_before &&
+ test_must_fail git rebase$type master &&
+ git rebase --abort &&
+ git reflog show to-rebase > reflog_after &&
+ test_cmp reflog_before reflog_after &&
+ rm reflog_before reflog_after
+ '
}
testrebase "" .git/rebase-apply