mirror of
https://github.com/git/git
synced 2024-11-05 18:59:29 +00:00
Reintegrate: handle merging from remote tracking branches
This commit is contained in:
parent
07635fa6ff
commit
dc8b63cc12
1 changed files with 17 additions and 4 deletions
21
Reintegrate
21
Reintegrate
|
@ -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) &&
|
||||
|
|
Loading…
Reference in a new issue