pull --rebase: Avoid spurious conflicts and reapplying unnecessary patches
[gitweb.git] / git-pull.sh
index 38331a861106c63bf5f421dbe03f4aafe949812e..5dbc4387f75658689bae24c294159bd91ed5c544 100755 (executable)
@@ -266,6 +266,15 @@ then
        exit
 fi
 
+if test true = "$rebase"
+then
+       o=$(git show-branch --merge-base $curr_branch $merge_head $oldremoteref)
+       if test "$oldremoteref" = "$o"
+       then
+               unset oldremoteref
+       fi
+fi
+
 merge_name=$(git fmt-merge-msg $log_arg <"$GIT_DIR/FETCH_HEAD") || exit
 case "$rebase" in
 true)