From ac5409e420e5fdd7c4a381f873ffcedfb83d7117 Mon Sep 17 00:00:00 2001 From: Junio C Hamano Date: Wed, 27 Sep 2006 01:58:57 -0700 Subject: update-ref: -d flag and ref creation safety. This adds -d flag to update-ref to allow safe deletion of ref. Before deleting it, the command checks if the given still matches the value the caller thought the ref contained. Similarly, it also accepts 0{40} or an empty string as to allow safe creation of a new ref. Signed-off-by: Junio C Hamano --- Documentation/git-update-ref.txt | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'Documentation/git-update-ref.txt') diff --git a/Documentation/git-update-ref.txt b/Documentation/git-update-ref.txt index e062030e91..71bcb7954f 100644 --- a/Documentation/git-update-ref.txt +++ b/Documentation/git-update-ref.txt @@ -7,7 +7,7 @@ git-update-ref - update the object name stored in a ref safely SYNOPSIS -------- -'git-update-ref' [-m ] [] +'git-update-ref' [-m ] (-d | []) DESCRIPTION ----------- @@ -20,7 +20,9 @@ possibly dereferencing the symbolic refs, after verifying that the current value of the matches . E.g. `git-update-ref refs/heads/master ` updates the master branch head to only if its current -value is . +value is . You can specify 40 "0" or an empty string +as to make sure that the ref you are creating does +not exist. It also allows a "ref" file to be a symbolic pointer to another ref file by starting with the four-byte header sequence of @@ -49,6 +51,10 @@ 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). +With `-d` flag, it deletes the named after verifying it +still contains . + + Logging Updates --------------- If config parameter "core.logAllRefUpdates" is true or the file -- cgit v1.2.3