1#!/bin/sh
2#
3# Copyright (c) 2006 Yann Dirson, based on t3400 by Amos Waterland
4#
56
test_description='git rebase should detect patches integrated upstream
78
This test cherry-picks one local change of two into master branch, and
9checks that git rebase succeeds with only the second patch in the
10local branch.
11'
12. ./test-lib.sh
1314
test_expect_success \
15'prepare repository with topic branch' \
16'echo First > A &&
17git-update-index --add A &&
18git-commit -m "Add A." &&
1920
git-checkout -b my-topic-branch &&
2122
echo Second > B &&
23git-update-index --add B &&
24git-commit -m "Add B." &&
2526
echo AnotherSecond > C &&
27git-update-index --add C &&
28git-commit -m "Add C." &&
2930
git-checkout -f master &&
3132
echo Third >> A &&
33git-update-index A &&
34git-commit -m "Modify A."
35'
3637
test_expect_success \
38'pick top patch from topic branch into master' \
39'git-cherry-pick my-topic-branch^0 &&
40git-checkout -f my-topic-branch &&
41git-branch master-merge master &&
42git-branch my-topic-branch-merge my-topic-branch
43'
4445
test_debug \
46'git-cherry master &&
47git-format-patch -k --stdout --full-index master >/dev/null &&
48gitk --all & sleep 1
49'
5051
test_expect_success \
52'rebase topic branch against new master and check git-am did not get halted' \
53'git-rebase master && test ! -d .dotest'
5455
if test -z "$no_python"
56then
57test_expect_success \
58'rebase --merge topic branch that was partially merged upstream' \
59'git-checkout -f my-topic-branch-merge &&
60git-rebase --merge master-merge &&
61test ! -d .git/.dotest-merge'
62fi
6364
test_done