From: Rudolf Polzer Date: Sun, 21 Nov 2010 14:59:58 +0000 (+0100) Subject: upstream rebase detection: verify that one of the two commits is upstream X-Git-Tag: xonotic-v0.1.0preview~36^2~7 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=7f21fe50c709a04174badcfa5b4115bc387849ac;p=xonotic%2Fxonotic.git upstream rebase detection: verify that one of the two commits is upstream --- diff --git a/all b/all index 5db6bae9..23acd27e 100755 --- a/all +++ b/all @@ -269,6 +269,17 @@ fix_upstream_rebase() if [ -z "$r_me" ] || [ -z "$r_other" ]; then return fi + + # one of the two sides of the merge should be remote upstream, or all is fine + r_r=`git symbolic-ref HEAD` + r_rem=`git config "branch.$r_rem.remote" || $ECHO origin` + r_bra=`git config "branch.$r_bra.merge" || $ECHO "$r_r"` + if [ x"$r_me" != x"`git rev-parse "$r_rem/$r_bra"`" ]; then + if [ x"$r_other" != x"`git rev-parse "$r_rem/$r_bra"`" ]; then + return + fi + fi + r_base=`git merge-base "$r_me" "$r_other"` # no merge-base? upstream did filter-branch