Ignore:
Timestamp:
Jun 23, 2014, 9:45:51 PM (11 years ago)
Author:
dmik
Message:

git: Merge version 2.0.0 from vendor to dmik branch.

Location:
git/branches/dmik
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • git/branches/dmik

  • TabularUnified git/branches/dmik/t/t3400-rebase.sh

    r626 r782  
    4141        git add C &&
    4242        git commit -m "Add C" &&
    43         git checkout -b nonlinear my-topic-branch &&
    44         echo Edit >>B &&
    45         git add B &&
    46         git commit -m "Modify B" &&
    47         git merge side &&
    48         git checkout -b upstream-merged-nonlinear &&
    49         git merge master &&
    5043        git checkout -f my-topic-branch &&
    5144        git tag topic
     
    6760'
    6861
    69 test_expect_success 'rebase against master twice' '
    70         git rebase master >out &&
    71         grep "Current branch my-topic-branch is up to date" out
    72 '
    73 
    74 test_expect_success 'rebase against master twice with --force' '
    75         git rebase --force-rebase master >out &&
    76         grep "Current branch my-topic-branch is up to date, rebase forced" out
    77 '
    78 
    79 test_expect_success 'rebase against master twice from another branch' '
    80         git checkout my-topic-branch^ &&
    81         git rebase master my-topic-branch >out &&
    82         grep "Current branch my-topic-branch is up to date" out
    83 '
    84 
    85 test_expect_success 'rebase fast-forward to master' '
    86         git checkout my-topic-branch^ &&
    87         git rebase my-topic-branch >out &&
    88         grep "Fast-forwarded HEAD to my-topic-branch" out
     62test_expect_success 'rebase, with <onto> and <upstream> specified as :/quuxery' '
     63        test_when_finished "git branch -D torebase" &&
     64        git checkout -b torebase my-topic-branch^ &&
     65        upstream=$(git rev-parse ":/Add B") &&
     66        onto=$(git rev-parse ":/Add A") &&
     67        git rebase --onto $onto $upstream &&
     68        git reset --hard my-topic-branch^ &&
     69        git rebase --onto ":/Add A" ":/Add B" &&
     70        git checkout my-topic-branch
    8971'
    9072
     
    10284'
    10385
    104 test_expect_success 'rebase after merge master' '
    105         git reset --hard topic &&
    106         git merge master &&
    107         git rebase master &&
    108         ! (git show | grep "^Merge:")
    109 '
    110 
    111 test_expect_success 'rebase of history with merges is linearized' '
    112         git checkout nonlinear &&
    113         test 4 = $(git rev-list master.. | wc -l) &&
    114         git rebase master &&
    115         test 3 = $(git rev-list master.. | wc -l)
    116 '
    117 
    118 test_expect_success 'rebase of history with merges after upstream merge is linearized' '
    119         git checkout upstream-merged-nonlinear &&
    120         test 5 = $(git rev-list master.. | wc -l) &&
    121         git rebase master &&
    122         test 3 = $(git rev-list master.. | wc -l)
     86test_expect_success 'rebase from ambiguous branch name' '
     87        git checkout -b topic side &&
     88        git rebase master
     89'
     90
     91test_expect_success 'rebase off of the previous branch using "-"' '
     92        git checkout master &&
     93        git checkout HEAD^ &&
     94        git rebase @{-1} >expect.messages &&
     95        git merge-base master HEAD >expect.forkpoint &&
     96
     97        git checkout master &&
     98        git checkout HEAD^ &&
     99        git rebase - >actual.messages &&
     100        git merge-base master HEAD >actual.forkpoint &&
     101
     102        test_cmp expect.forkpoint actual.forkpoint &&
     103        # the next one is dubious---we may want to say "-",
     104        # instead of @{-1}, in the message
     105        test_i18ncmp expect.messages actual.messages
    123106'
    124107
    125108test_expect_success 'rebase a single mode change' '
    126109        git checkout master &&
     110        git branch -D topic &&
    127111        echo 1 >X &&
    128112        git add X &&
     
    139123
    140124test_expect_success 'rebase is not broken by diff.renames' '
    141         git config diff.renames copies &&
    142         test_when_finished "git config --unset diff.renames" &&
     125        test_config diff.renames copies &&
    143126        git checkout filemove &&
    144127        GIT_TRACE=1 git rebase force-3way
     
    161144test_expect_success 'fail when upstream arg is missing and not on branch' '
    162145        git checkout topic &&
    163         test_must_fail git rebase >output.out &&
    164         grep "You are not currently on a branch" output.out
     146        test_must_fail git rebase
    165147'
    166148
    167149test_expect_success 'fail when upstream arg is missing and not configured' '
    168150        git checkout -b no-config topic &&
    169         test_must_fail git rebase >output.out &&
    170         grep "branch.no-config.merge" output.out
    171 '
    172 
    173 test_expect_success 'default to @{upstream} when upstream arg is missing' '
     151        test_must_fail git rebase
     152'
     153
     154test_expect_success 'default to common base in @{upstream}s reflog if no upstream arg' '
     155        git checkout -b default-base master &&
    174156        git checkout -b default topic &&
    175157        git config branch.default.remote . &&
    176         git config branch.default.merge refs/heads/master &&
     158        git config branch.default.merge refs/heads/default-base &&
    177159        git rebase &&
    178         test "$(git rev-parse default~1)" = "$(git rev-parse master)"
     160        git rev-parse --verify default-base >expect &&
     161        git rev-parse default~1 >actual &&
     162        test_cmp expect actual &&
     163        git checkout default-base &&
     164        git reset --hard HEAD^ &&
     165        git checkout default &&
     166        git rebase &&
     167        git rev-parse --verify default-base >expect &&
     168        git rev-parse default~1 >actual &&
     169        test_cmp expect actual
    179170'
    180171
     
    182173        git checkout -b quiet topic &&
    183174        git rebase -q master >output.out 2>&1 &&
    184         test ! -s output.out
     175        test_must_be_empty output.out
    185176'
    186177
Note: See TracChangeset for help on using the changeset viewer.