]> Pileus Git - ~andy/git/blobdiff - t/t3412-rebase-root.sh
Merge branch 'tb/sanitize-decomposed-utf-8-pathname'
[~andy/git] / t / t3412-rebase-root.sh
index 5869061c5bfdee4a84b156b8ec9d6e331a2c906c..1e9d1a737c5369d1b41bfa75f5939ad41004b944 100755 (executable)
@@ -23,9 +23,15 @@ test_expect_success 'prepare repository' '
 '
 
 test_expect_success 'rebase --root expects --onto' '
+       git checkout -B fail other &&
        test_must_fail git rebase --root
 '
 
+test_expect_success 'rebase --root fails with too many args' '
+       git checkout -B fail other &&
+       test_must_fail git rebase --onto master --root fail fail
+'
+
 test_expect_success 'setup pre-rebase hook' '
        mkdir -p .git/hooks &&
        cat >.git/hooks/pre-rebase <<EOF &&
@@ -42,7 +48,7 @@ cat > expect <<EOF
 EOF
 
 test_expect_success 'rebase --root --onto <newbase>' '
-       git checkout -b work &&
+       git checkout -b work other &&
        git rebase --root --onto master &&
        git log --pretty=tformat:"%s" > rebased &&
        test_cmp expect rebased
@@ -173,14 +179,14 @@ EOF
 test_expect_success 'pre-rebase hook stops rebase' '
        git checkout -b stops1 other &&
        test_must_fail git rebase --root --onto master &&
-       test "z$(git symbolic-ref HEAD)" = zrefs/heads/stops1
+       test "z$(git symbolic-ref HEAD)" = zrefs/heads/stops1 &&
        test 0 = $(git rev-list other...stops1 | wc -l)
 '
 
 test_expect_success 'pre-rebase hook stops rebase -i' '
        git checkout -b stops2 other &&
        test_must_fail git rebase --root --onto master &&
-       test "z$(git symbolic-ref HEAD)" = zrefs/heads/stops2
+       test "z$(git symbolic-ref HEAD)" = zrefs/heads/stops2 &&
        test 0 = $(git rev-list other...stops2 | wc -l)
 '