1#!/bin/sh2#3# Copyright (c) 2006 Yann Dirson, based on t3400 by Amos Waterland4#56test_description='git rebase should detect patches integrated upstream78This test cherry-picks one local change of two into master branch, and9checks that git rebase succeeds with only the second patch in the10local branch.11'12. ./test-lib.sh1314test_expect_success \15'prepare repository with topic branch' \16'echo First > A &&17git-update-index --add A &&18git-commit -m "Add A." &&1920git-checkout -b my-topic-branch &&2122echo Second > B &&23git-update-index --add B &&24git-commit -m "Add B." &&2526echo AnotherSecond > C &&27git-update-index --add C &&28git-commit -m "Add C." &&2930git-checkout -f master &&3132echo Third >> A &&33git-update-index A &&34git-commit -m "Modify A."35'3637test_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-branch43'4445test_debug \46'git-cherry master &&47git-format-patch -k --stdout --full-index master >/dev/null &&48gitk --all & sleep 149'5051test_expect_success \52'rebase topic branch against new master and check git-am did not get halted' \53'git-rebase master && test ! -d .dotest'5455if test -z "$no_python"56then57test_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'62fi6364test_done