aboutsummaryrefslogtreecommitdiff
path: root/git-resolve-script
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@ppc970.osdl.org>2005-06-05 22:07:31 -0700
committerLinus Torvalds <torvalds@ppc970.osdl.org>2005-06-05 22:07:31 -0700
commit220a0b527bd6ecd30a9d6dfed22195c95e6f445a (patch)
treec788895bfca71435d016d554c79b2d504b445550 /git-resolve-script
parent12dccc165400beae564d2357ce86c71937e5cdc0 (diff)
downloadgit-220a0b527bd6ecd30a9d6dfed22195c95e6f445a.tar.gz
git-220a0b527bd6ecd30a9d6dfed22195c95e6f445a.tar.xz
More work on merging with git-read-tree..
Add a "-u" flag to update the tree as a result of a merge. Right now this code is way too anal about things, and fails merges it shouldn't, but let me fix up the different cases and this will allow for much smoother merging even in the presense of dirty data in the working tree.
Diffstat (limited to 'git-resolve-script')
-rw-r--r--git-resolve-script6
1 files changed, 2 insertions, 4 deletions
diff --git a/git-resolve-script b/git-resolve-script
index 4fc7a6dce..186b234b2 100644
--- a/git-resolve-script
+++ b/git-resolve-script
@@ -39,14 +39,13 @@ if [ "$common" == "$head" ]; then
echo "Destroying all noncommitted data!"
echo "Kill me within 3 seconds.."
sleep 3
- git-read-tree -m $merge || exit 1
- git-checkout-cache -f -u -a
+ git-read-tree -u -m $head $merge || exit 1
echo $merge > "$GIT_DIR"/HEAD
git-diff-tree -p ORIG_HEAD HEAD | git-apply --stat
exit 0
fi
echo "Trying to merge $merge into $head"
-git-read-tree -m $common $head $merge || exit 1
+git-read-tree -u -m $common $head $merge || exit 1
merge_msg="Merge of $merge_repo"
result_tree=$(git-write-tree 2> /dev/null)
if [ $? -ne 0 ]; then
@@ -58,5 +57,4 @@ fi
result_commit=$(echo "$merge_msg" | git-commit-tree $result_tree -p $head -p $merge)
echo "Committed merge $result_commit"
echo $result_commit > "$GIT_DIR"/HEAD
-git-checkout-cache -f -u -a
git-diff-tree -p ORIG_HEAD HEAD | git-apply --stat