summaryrefslogtreecommitdiff
path: root/git-merge.sh
diff options
context:
space:
mode:
authorJunio C Hamano <junkio@cox.net>2007-01-14 12:03:53 -0800
committerJunio C Hamano <junkio@cox.net>2007-01-14 12:03:53 -0800
commit6de33478affbf252066cc5863add213ca5cdc13c (patch)
tree59c31712816d4f75e3d86fcd742bf9b3bd1d0804 /git-merge.sh
parent3681d40b965258f7559235642c75f2117476765e (diff)
parentc82d7117a1f499b43e21e0a4589a080edadaf706 (diff)
downloadgit-6de33478affbf252066cc5863add213ca5cdc13c.tar.gz
Merge branch 'sp/merge' (early part)
* 'sp/merge' (early part): Improve merge performance by avoiding in-index merges.
Diffstat (limited to 'git-merge.sh')
-rwxr-xr-xgit-merge.sh40
1 files changed, 23 insertions, 17 deletions
diff --git a/git-merge.sh b/git-merge.sh
index 7de83dc76c..7b590268ed 100755
--- a/git-merge.sh
+++ b/git-merge.sh
@@ -301,24 +301,30 @@ f,*)
;;
?,1,*,)
# We are not doing octopus, not fast forward, and have only
- # one common. See if it is really trivial.
- git var GIT_COMMITTER_IDENT >/dev/null || exit
-
- echo "Trying really trivial in-index merge..."
+ # one common.
git-update-index --refresh 2>/dev/null
- if git-read-tree --trivial -m -u -v $common $head "$1" &&
- result_tree=$(git-write-tree)
- then
- echo "Wonderful."
- result_commit=$(
- echo "$merge_msg" |
- git-commit-tree $result_tree -p HEAD -p "$1"
- ) || exit
- finish "$result_commit" "In-index merge"
- dropsave
- exit 0
- fi
- echo "Nope."
+ case " $use_strategies " in
+ *' recursive '*|*' recur '*)
+ : run merge later
+ ;;
+ *)
+ # See if it is really trivial.
+ git var GIT_COMMITTER_IDENT >/dev/null || exit
+ echo "Trying really trivial in-index merge..."
+ if git-read-tree --trivial -m -u -v $common $head "$1" &&
+ result_tree=$(git-write-tree)
+ then
+ echo "Wonderful."
+ result_commit=$(
+ echo "$merge_msg" |
+ git-commit-tree $result_tree -p HEAD -p "$1"
+ ) || exit
+ finish "$result_commit" "In-index merge"
+ dropsave
+ exit 0
+ fi
+ echo "Nope."
+ esac
;;
*)
# An octopus. If we can reach all the remote we are up to date.