summaryrefslogtreecommitdiff
path: root/git-rebase.sh
diff options
context:
space:
mode:
authorEric Wong <normalperson@yhbt.net>2006-06-24 18:29:47 -0700
committerJunio C Hamano <junkio@cox.net>2006-06-25 00:38:34 -0700
commit9a99c087da7cd6b4a41c19df3053542f645315c5 (patch)
treee639c4ffdc84d047d993722cac034c7c7ddf56e9 /git-rebase.sh
parent29f4ad867cd15f4029c280c417f4a0866d5229a9 (diff)
downloadgit-9a99c087da7cd6b4a41c19df3053542f645315c5.tar.gz
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: Eric Wong <normalperson@yhbt.net> Signed-off-by: Junio C Hamano <junkio@cox.net>
Diffstat (limited to 'git-rebase.sh')
-rwxr-xr-xgit-rebase.sh15
1 files changed, 11 insertions, 4 deletions
diff --git a/git-rebase.sh b/git-rebase.sh
index 91594775e6..53fb14ed88 100755
--- a/git-rebase.sh
+++ b/git-rebase.sh
@@ -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))