summaryrefslogtreecommitdiff
path: root/t/t3400-rebase.sh
diff options
context:
space:
mode:
authorJonathan Nieder <jrnieder@gmail.com>2010-05-31 22:51:32 (GMT)
committerJunio C Hamano <gitster@pobox.com>2010-06-01 00:53:23 (GMT)
commitbffd750adf98c4a377571af73cf9a589f86495fb (patch)
treea8e22d08bfebb382b058b037f47699f1a7c57997 /t/t3400-rebase.sh
parent81fa024cd8e336ba257f13fe7724b95baacfa3ad (diff)
downloadgit-bffd750adf98c4a377571af73cf9a589f86495fb.zip
git-bffd750adf98c4a377571af73cf9a589f86495fb.tar.gz
git-bffd750adf98c4a377571af73cf9a589f86495fb.tar.bz2
rebase: improve error message when upstream argument is missing
Strip out options before checking for a missing upstream argument. Before: $ git rebase -m shift: 426: can't shift that many After: $ git rebase -m Usage: git rebase ... While at it, fix the usage message to explain that the upstream argument is mandatory. Reported-by: Jon Dowland <jmtd@debian.org> Signed-off-by: Jonathan Nieder <jrnieder@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t3400-rebase.sh')
-rwxr-xr-xt/t3400-rebase.sh13
1 files changed, 12 insertions, 1 deletions
diff --git a/t/t3400-rebase.sh b/t/t3400-rebase.sh
index dbf7dfb..e5691bc 100755
--- a/t/t3400-rebase.sh
+++ b/t/t3400-rebase.sh
@@ -126,9 +126,20 @@ test_expect_success 'Show verbose error when HEAD could not be detached' '
test_must_fail git rebase topic 2> output.err > output.out &&
grep "Untracked working tree file .B. would be overwritten" output.err
'
+rm -f B
+
+test_expect_success 'dump usage when upstream arg is missing' '
+ git checkout -b usage topic &&
+ test_must_fail git rebase 2>error1 &&
+ grep "[Uu]sage" error1 &&
+ test_must_fail git rebase --abort 2>error2 &&
+ grep "No rebase in progress" error2 &&
+ test_must_fail git rebase --onto master 2>error3 &&
+ grep "[Uu]sage" error3 &&
+ ! grep "can.t shift" error3
+'
test_expect_success 'rebase -q is quiet' '
- rm B &&
git checkout -b quiet topic &&
git rebase -q master > output.out 2>&1 &&
test ! -s output.out