t/rebase: add failing tests for a peculiar revision
The following commands fail, even if :/quuxery and :/foomery resolve to perfectly valid commits: $ git rebase [-i] --onto :/quuxery :/foomery This is because rebase [-i] attempts to rev-parse ${REV}^0 to verify that the given revision resolves to a commit. Add tests to document these failures. Signed-off-by: Ramkumar Ramachandra <artagnon@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Ramkumar Ramachandra committed
Jun 14, 2013 at 18:47 UTC
6567dc05a34948b959864b12fcd59a35543273f7
2 files changed
+22
t/t3400-rebase.sh
+11
@@ -88,6 +88,17 @@ test_expect_success 'rebase fast-forward to master' '
88
test_i18ngrep "Fast-forwarded HEAD to my-topic-branch" out
89
'
90
91
+test_expect_failure 'rebase, with <onto> and <upstream> specified as :/quuxery' '
92
+ test_when_finished "git branch -D torebase" &&
93
+ git checkout -b torebase my-topic-branch^ &&
94
+ upstream=$(git rev-parse ":/Add B") &&
95
+ onto=$(git rev-parse ":/Add A") &&
96
+ git rebase --onto $onto $upstream &&
97
+ git reset --hard my-topic-branch^ &&
98
+ git rebase --onto ":/Add A" ":/Add B" &&
99
+ git checkout my-topic-branch
100
+'
101
+
102
test_expect_success 'the rebase operation should not have destroyed author information' '
103
! (git log | grep "Author:" | grep "<>")
104
'
t/t3404-rebase-interactive.sh
+11
@@ -947,4 +947,15 @@ test_expect_success 'rebase -i respects core.commentchar' '
947
test B = $(git cat-file commit HEAD^ | sed -ne \$p)
948
'
949
950
+test_expect_failure 'rebase -i, with <onto> and <upstream> specified as :/quuxery' '
951
+ test_when_finished "git branch -D torebase" &&
952
+ git checkout -b torebase branch1 &&
953
+ upstream=$(git rev-parse ":/J") &&
954
+ onto=$(git rev-parse ":/A") &&
955
+ git rebase --onto $onto $upstream &&
956
+ git reset --hard branch1 &&
957
+ git rebase --onto ":/A" ":/J" &&
958
+ git checkout branch1
959
+'
960
+
961
test_done