Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@osdl.org>2005-09-25 22:43:05 +0400
committerJunio C Hamano <junkio@cox.net>2005-09-26 03:18:25 +0400
commit66bf85a462893f9df7e516a5f334dbba08122617 (patch)
treece3cd9a0cece3301f499e284263434792629b96c /Makefile
parent8cc01e5019e0dc9a86bba4cba414b46627fe0424 (diff)
[PATCH] Add "git-update-ref" to update the HEAD (or other) ref
This is a careful version of the script stuff that currently just blindly writes HEAD with a new value. You can use git-update-ref HEAD <newhead> or git-update-ref HEAD <newhead> <oldhead> where the latter version verifies that the old value of HEAD matches oldhead. It basically allows a "ref" file to be a symbolic pointer to another ref file by starting with the four-byte header sequence of "ref:". More importantly, it allows the update of a ref file to follow these symbolic pointers, whether they are symlinks or these "regular file symbolic refs". NOTE! It follows _real_ symlinks only if they start with "refs/": otherwise it will just try to read them and update them as a regular file (ie it will allow the filesystem to follow them, but will overwrite such a symlink to somewhere else with a regular filename). In general, using git-update-ref HEAD "$head" should be a _lot_ safer than doing echo "$head" > "$GIT_DIR/HEAD" both from a symlink following standpoint _and_ an error checking standpoint. The "refs/" rule for symlinks means that symlinks that point to "outside" the tree are safe: they'll be followed for reading but not for writing (so we'll never write through a ref symlink to some other tree, if you have copied a whole archive by creating a symlink tree). Signed-off-by: Linus Torvalds <torvalds@osdl.org> Signed-off-by: Junio C Hamano <junkio@cox.net>
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile1
1 files changed, 1 insertions, 0 deletions
diff --git a/Makefile b/Makefile
index d18153de5d..afd4b14c41 100644
--- a/Makefile
+++ b/Makefile
@@ -116,6 +116,7 @@ PROGRAMS = \
git-ssh-upload git-tar-tree git-unpack-file \
git-unpack-objects git-update-index git-update-server-info \
git-upload-pack git-verify-pack git-write-tree \
+ git-update-ref \
$(SIMPLE_PROGRAMS)
# Backward compatibility -- to be removed in 0.99.8