t7406-submodule-update: add missing &&
[gitweb.git] / t / t3400-rebase.sh
index b58fa1a23243e435f119afb9966b0a80cbc1e4d4..ebf93b0695dfac37fc276e1f07377d858eb3e1da 100755 (executable)
@@ -40,13 +40,6 @@ test_expect_success 'prepare repository with topic branches' '
        echo Side >>C &&
        git add C &&
        git commit -m "Add C" &&
-       git checkout -b nonlinear my-topic-branch &&
-       echo Edit >>B &&
-       git add B &&
-       git commit -m "Modify B" &&
-       git merge side &&
-       git checkout -b upstream-merged-nonlinear &&
-       git merge master &&
        git checkout -f my-topic-branch &&
        git tag topic
 '
@@ -66,26 +59,15 @@ test_expect_success 'rebase against master' '
        git rebase master
 '
 
-test_expect_success 'rebase against master twice' '
-       git rebase master >out &&
-       test_i18ngrep "Current branch my-topic-branch is up to date" out
-'
-
-test_expect_success 'rebase against master twice with --force' '
-       git rebase --force-rebase master >out &&
-       test_i18ngrep "Current branch my-topic-branch is up to date, rebase forced" out
-'
-
-test_expect_success 'rebase against master twice from another branch' '
-       git checkout my-topic-branch^ &&
-       git rebase master my-topic-branch >out &&
-       test_i18ngrep "Current branch my-topic-branch is up to date" out
-'
-
-test_expect_success 'rebase fast-forward to master' '
-       git checkout my-topic-branch^ &&
-       git rebase my-topic-branch >out &&
-       test_i18ngrep "Fast-forwarded HEAD to my-topic-branch" out
+test_expect_success 'rebase, with <onto> and <upstream> specified as :/quuxery' '
+       test_when_finished "git branch -D torebase" &&
+       git checkout -b torebase my-topic-branch^ &&
+       upstream=$(git rev-parse ":/Add B") &&
+       onto=$(git rev-parse ":/Add A") &&
+       git rebase --onto $onto $upstream &&
+       git reset --hard my-topic-branch^ &&
+       git rebase --onto ":/Add A" ":/Add B" &&
+       git checkout my-topic-branch
 '
 
 test_expect_success 'the rebase operation should not have destroyed author information' '
@@ -106,31 +88,9 @@ test_expect_success 'rebase from ambiguous branch name' '
        git rebase master
 '
 
-test_expect_success 'rebase after merge master' '
-       git checkout --detach refs/tags/topic &&
-       git branch -D topic &&
-       git reset --hard topic &&
-       git merge master &&
-       git rebase master &&
-       ! (git show | grep "^Merge:")
-'
-
-test_expect_success 'rebase of history with merges is linearized' '
-       git checkout nonlinear &&
-       test 4 = $(git rev-list master.. | wc -l) &&
-       git rebase master &&
-       test 3 = $(git rev-list master.. | wc -l)
-'
-
-test_expect_success 'rebase of history with merges after upstream merge is linearized' '
-       git checkout upstream-merged-nonlinear &&
-       test 5 = $(git rev-list master.. | wc -l) &&
-       git rebase master &&
-       test 3 = $(git rev-list master.. | wc -l)
-'
-
 test_expect_success 'rebase a single mode change' '
        git checkout master &&
+       git branch -D topic &&
        echo 1 >X &&
        git add X &&
        test_tick &&
@@ -185,7 +145,7 @@ test_expect_success 'default to @{upstream} when upstream arg is missing' '
 test_expect_success 'rebase -q is quiet' '
        git checkout -b quiet topic &&
        git rebase -q master >output.out 2>&1 &&
-       test ! -s output.out
+       test_must_be_empty output.out
 '
 
 test_expect_success 'Rebase a commit that sprinkles CRs in' '