提交 9a99c087 编写于 作者: E Eric Wong 提交者: Junio C Hamano

rebase: allow --merge option to handle patches merged upstream

Enhance t3401-rebase-partial to test with --merge as well as
the standard am -3 strategy.
Signed-off-by: NEric Wong <normalperson@yhbt.net>
Signed-off-by: NJunio C Hamano <junkio@cox.net>
上级 29f4ad86
......@@ -82,7 +82,10 @@ call_merge () {
rv=$?
case "$rv" in
0)
git-commit -C "$cmt" || die "commit failed: $MRESOLVEMSG"
if test -n "`git-diff-index HEAD`"
then
git-commit -C "$cmt" || die "commit failed: $MRESOLVEMSG"
fi
;;
1)
test -d "$GIT_DIR/rr-cache" && git-rerere
......@@ -110,9 +113,13 @@ finish_rb_merge () {
do
git-read-tree `cat "$dotest/cmt.$msgnum.result"`
git-checkout-index -q -f -u -a
git-commit -C "`cat $dotest/cmt.$msgnum`"
printf "Committed %0${prec}d" $msgnum
if test -n "`git-diff-index HEAD`"
then
git-commit -C "`cat $dotest/cmt.$msgnum`"
printf "Committed %0${prec}d" $msgnum
else
printf "Already applied: %0${prec}d" $msgnum
fi
echo ' '`git-rev-list --pretty=oneline -1 HEAD | \
sed 's/^[a-f0-9]\+ //'`
msgnum=$(($msgnum + 1))
......
......@@ -37,7 +37,9 @@ test_expect_success \
test_expect_success \
'pick top patch from topic branch into master' \
'git-cherry-pick my-topic-branch^0 &&
git-checkout -f my-topic-branch
git-checkout -f my-topic-branch &&
git-branch master-merge master &&
git-branch my-topic-branch-merge my-topic-branch
'
test_debug \
......@@ -50,4 +52,13 @@ test_expect_success \
'rebase topic branch against new master and check git-am did not get halted' \
'git-rebase master && test ! -d .dotest'
if test -z "$no_python"
then
test_expect_success \
'rebase --merge topic branch that was partially merged upstream' \
'git-checkout -f my-topic-branch-merge &&
git-rebase --merge master-merge &&
test ! -d .git/.dotest-merge'
fi
test_done
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册