summaryrefslogtreecommitdiff
path: root/Documentation/git-read-tree.txt
diff options
context:
space:
mode:
authorJoey Hess <joey@kitenet.net>2011-12-26 12:16:56 -0400
committerJunio C Hamano <gitster@pobox.com>2012-01-03 16:13:14 -0800
commit96890f4c428ed62cf52c11aba5773d364a8d6234 (patch)
treef28b7b8a60ccb3f88442274fb100ae555886f9e4 /Documentation/git-read-tree.txt
parentec330158ec04849fe5ff2cb8749797cd63ae592b (diff)
downloadgit-96890f4c428ed62cf52c11aba5773d364a8d6234.tar.gz
write first for-merge ref to FETCH_HEAD firstjh/fetch-head-update
The FETCH_HEAD refname is supposed to refer to the ref that was fetched and should be merged. However all fetched refs are written to .git/FETCH_HEAD in an arbitrary order, and resolve_ref_unsafe simply takes the first ref as the FETCH_HEAD, which is often the wrong one, when other branches were also fetched. The solution is to write the for-merge ref(s) to FETCH_HEAD first. Then, unless --append is used, the FETCH_HEAD refname behaves as intended. If the user uses --append, they presumably are doing so in order to preserve the old FETCH_HEAD. While we are at it, update an old example in the read-tree documentation that implied that each entry in FETCH_HEAD only has the object name, which is not true for quite a while. [jc: adjusted tests] Signed-off-by: Joey Hess <joey@kitenet.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'Documentation/git-read-tree.txt')
-rw-r--r--Documentation/git-read-tree.txt2
1 files changed, 1 insertions, 1 deletions
diff --git a/Documentation/git-read-tree.txt b/Documentation/git-read-tree.txt
index 5375549820..2d3ff235d4 100644
--- a/Documentation/git-read-tree.txt
+++ b/Documentation/git-read-tree.txt
@@ -342,7 +342,7 @@ since you pulled from him:
----------------
$ git fetch git://.... linus
-$ LT=`cat .git/FETCH_HEAD`
+$ LT=`git rev-parse FETCH_HEAD`
----------------
Your work tree is still based on your HEAD ($JC), but you have