Browse Source

Merge branch 'sp/merge' (early part)

* 'sp/merge' (early part):
  Improve merge performance by avoiding in-index merges.
maint
Junio C Hamano 18 years ago
parent
commit
6de33478af
  1. 12
      git-merge.sh

12
git-merge.sh

@ -301,11 +301,16 @@ f,*)
;; ;;
?,1,*,) ?,1,*,)
# We are not doing octopus, not fast forward, and have only # We are not doing octopus, not fast forward, and have only
# one common. See if it is really trivial. # one common.
git-update-index --refresh 2>/dev/null
case " $use_strategies " in
*' recursive '*|*' recur '*)
: run merge later
;;
*)
# See if it is really trivial.
git var GIT_COMMITTER_IDENT >/dev/null || exit git var GIT_COMMITTER_IDENT >/dev/null || exit

echo "Trying really trivial in-index merge..." echo "Trying really trivial in-index merge..."
git-update-index --refresh 2>/dev/null
if git-read-tree --trivial -m -u -v $common $head "$1" && if git-read-tree --trivial -m -u -v $common $head "$1" &&
result_tree=$(git-write-tree) result_tree=$(git-write-tree)
then then
@ -319,6 +324,7 @@ f,*)
exit 0 exit 0
fi fi
echo "Nope." echo "Nope."
esac
;; ;;
*) *)
# An octopus. If we can reach all the remote we are up to date. # An octopus. If we can reach all the remote we are up to date.

Loading…
Cancel
Save