]>
git.ipfire.org Git - thirdparty/git.git/blob - t/t3500-cherry.sh
3 # Copyright (c) 2006 Yann Dirson, based on t3400 by Amos Waterland
6 test_description
='git cherry should detect patches integrated upstream
8 This test cherry-picks one local change of two into master branch, and
9 checks that git cherry only returns the second patch in the local branch
13 GIT_AUTHOR_EMAIL
=bogus_email_address
14 export GIT_AUTHOR_EMAIL
17 'prepare repository with topic branch, and check cherry finds the 2 patches from there' \
19 git update-index --add A &&
21 git commit -m "Add A." &&
23 git checkout -b my-topic-branch &&
26 git update-index --add B &&
28 git commit -m "Add B." &&
30 echo AnotherSecond > C &&
31 git update-index --add C &&
33 git commit -m "Add C." &&
35 git checkout -f master &&
41 git commit -m "Modify A." &&
43 expr "$(echo $(git cherry master my-topic-branch) )" : "+ [^ ]* + .*"
47 'check that cherry with limit returns only the top patch'\
48 'expr "$(echo $(git cherry master my-topic-branch my-topic-branch^1) )" : "+ [^ ]*"
52 'cherry-pick one of the 2 patches, and check cherry recognized one and only one as new' \
53 'git cherry-pick my-topic-branch^0 &&
54 echo $(git cherry master my-topic-branch) &&
55 expr "$(echo $(git cherry master my-topic-branch) )" : "+ [^ ]* - .*"