The following commands fail, even if :/quuxery resolves to a perfectly
valid commit:

  $ git rebase :/quuxery
  $ git rebase -i :/quuxery

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 <artag...@gmail.com>
---
 t/t3400-rebase.sh             | 8 ++++++++
 t/t3404-rebase-interactive.sh | 8 ++++++++
 2 files changed, 16 insertions(+)

diff --git a/t/t3400-rebase.sh b/t/t3400-rebase.sh
index b58fa1a..890f159 100755
--- a/t/t3400-rebase.sh
+++ b/t/t3400-rebase.sh
@@ -88,6 +88,14 @@ test_expect_success 'rebase fast-forward to master' '
        test_i18ngrep "Fast-forwarded HEAD to my-topic-branch" out
 '
 
+test_expect_failure 'rebase against revision specified as :/quuxery' '
+       git checkout my-topic-branch^ &&
+       sha1=$(git rev-parse ":/Add B") &&
+       git rebase $sha1 &&
+       git checkout my-topic-branch^ &&
+       git rebase ":/Add B"
+'
+
 test_expect_success 'the rebase operation should not have destroyed author 
information' '
        ! (git log | grep "Author:" | grep "<>")
 '
diff --git a/t/t3404-rebase-interactive.sh b/t/t3404-rebase-interactive.sh
index 79e8d3c..ca4ee92 100755
--- a/t/t3404-rebase-interactive.sh
+++ b/t/t3404-rebase-interactive.sh
@@ -947,4 +947,12 @@ test_expect_success 'rebase -i respects core.commentchar' '
        test B = $(git cat-file commit HEAD^ | sed -ne \$p)
 '
 
+test_expect_failure 'rebase -i against revision specified as :/quuxery' '
+       git checkout branch1 &&
+       sha1=$(git rev-parse ":/J") &&
+       git rebase $sha1 &&
+       git checkout branch1 &&
+       git rebase ":/J"
+'
+
 test_done
-- 
1.8.3.1.381.g31c8856.dirty

--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to