Reintegrate: handle merging from remote tracking branches

This commit is contained in:
Junio C Hamano 2010-01-10 11:12:42 -08:00
parent 07635fa6ff
commit dc8b63cc12

View file

@ -25,6 +25,7 @@ no)
return 1
else
EDITOR=: git commit -a --no-verify
echo "Accepted previous resolution"
return 0
fi
}
@ -50,16 +51,28 @@ no)
exit
esac
merge_msg="Merge branch '\(.*\)'"
x40='[0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f]'
x40="$x40$x40$x40$x40$x40$x40$x40$x40"
LF='
'
show_merge () {
branch=$(expr "$msg" : "$merge_msg") &&
tip=$(git rev-parse --verify "refs/heads/$branch" 2>/dev/null) &&
merged=$(git name-rev --refs="refs/heads/$branch" "$other" 2>/dev/null) &&
case "$msg" in
"Merge branch '"*"'"*" into "*)
branch=$(expr "$msg" : "Merge branch '\(.*\)'")
merge_hier=heads/
;;
"Merge remote branch '"*"'"*" into "*)
branch=$(expr "$msg" : "Merge remote branch '\(.*\)'")
merge_hier=
;;
*)
echo 2>&1 "Huh?: $msg"
exit 1
;;
esac &&
tip=$(git rev-parse --verify "refs/$merge_hier$branch" 2>/dev/null) &&
merged=$(git name-rev --refs="refs/$merge_hier$branch" "$other" 2>/dev/null) &&
merged=$(expr "$merged" : "$x40 \(.*\)") &&
test "$merged" != undefined || {
other=$(git log -1 --pretty='format:%s' $other) &&