Thread (5 messages) flat view 5 messages, 3 authors, 2016-06-15

Re: [PATCH] pull: pull into void by fast-forwarding from empty tree

From: Ramkumar Ramachandra <hidden>
Date: 2016-06-15 22:57:51

Thomas Rast wrote:
quoted hunk ↗ jump to hunk
diff --git a/git-pull.sh b/git-pull.sh
index 638aabb..1f84383 100755
--- a/git-pull.sh
+++ b/git-pull.sh
@@ -266,10 +266,17 @@ case "$merge_head" in
        ;;
 esac

+# Pulling into unborn branch: a shorthand for branching off
+# FETCH_HEAD, for lazy typers.
 if test -z "$orig_head"
 then
        git update-ref -m "initial pull" HEAD $merge_head "$curr_head" &&
-       git read-tree -m -u HEAD || exit 1
+       # Two-way merge: we claim the index is based on an empty tree,
+       # and try to fast-forward to HEAD.  This ensures we will not
+       # lose index/worktree changes that the user already made on
+       # the unborn branch.
+       empty_tree=4b825dc642cb6eb9a060e54bf8d69288fbee4904
Perhaps replace this magic with $(git hash-object -t tree /dev/null)
or $(git mktree </dev/null)?
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help