3 # Copyright (c) 2006 Yann Dirson, based on t3400 by Amos Waterland
6 test_description
='git rebase should detect patches integrated upstream
8 This test cherry-picks one local change of two into master branch, and
9 checks that git rebase succeeds with only the second patch in the
14 test_expect_success
'prepare repository with topic branch' '
16 git checkout -b my-topic-branch &&
19 git checkout -f master &&
23 test_expect_success
'pick top patch from topic branch into master' '
25 git checkout -f my-topic-branch
30 git format-patch -k --stdout --full-index master >/dev/null &&
34 test_expect_success
'rebase topic branch against new master and check git am did not get halted' '
36 test_path_is_missing .git/rebase-apply
39 test_expect_success
'rebase --merge topic branch that was partially merged upstream' '
41 git rebase --merge master &&
42 test_path_is_missing .git/rebase-merge
45 test_expect_success
'rebase ignores empty commit' '
47 git commit --allow-empty -m empty &&
50 test "$(git log --format=%s C..)" = "D"
53 test_expect_success
'rebase --keep-empty' '
55 git rebase --keep-empty C &&
56 test "$(git log --format=%s C..)" = "D
60 test_expect_success
'rebase --keep-empty keeps empty even if already in upstream' '
62 git commit --allow-empty -m also-empty &&
63 git rebase --keep-empty D &&
64 test "$(git log --format=%s A..)" = "also-empty