summaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorJohannes Schindelin <Johannes.Schindelin@gmx.de>2007-12-17 21:01:25 (GMT)
committerJunio C Hamano <gitster@pobox.com>2007-12-18 04:49:18 (GMT)
commit34454e858d2a648b0a6ce56acd9def84bd2a8712 (patch)
tree724903c66c5c2d6935207393da2623502e5191c4 /t
parent77680caadb939cf47fd08447b81faadc7c3bd436 (diff)
downloadgit-34454e858d2a648b0a6ce56acd9def84bd2a8712.zip
git-34454e858d2a648b0a6ce56acd9def84bd2a8712.tar.gz
git-34454e858d2a648b0a6ce56acd9def84bd2a8712.tar.bz2
rebase -p -i: handle "no changes" gracefully
Since commit 376ccb8cbb453343998e734d8a1ce79f57a4e092 (rebase -i: style fixes and minor cleanups), unchanged SHA-1s are no longer mapped via $REWRITTEN. But the updating phase was not prepared for the old head not being rewritten. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't')
-rwxr-xr-xt/t3404-rebase-interactive.sh6
1 files changed, 6 insertions, 0 deletions
diff --git a/t/t3404-rebase-interactive.sh b/t/t3404-rebase-interactive.sh
index 907c7f9..74a7eb3 100755
--- a/t/t3404-rebase-interactive.sh
+++ b/t/t3404-rebase-interactive.sh
@@ -184,6 +184,12 @@ test_expect_success 'retain authorship when squashing' '
git show HEAD | grep "^Author: Twerp Snog"
'
+test_expect_success '-p handles "no changes" gracefully' '
+ HEAD=$(git rev-parse HEAD) &&
+ git rebase -i -p HEAD^ &&
+ test $HEAD = $(git rev-parse HEAD)
+'
+
test_expect_success 'preserve merges with -p' '
git checkout -b to-be-preserved master^ &&
: > unrelated-file &&