summaryrefslogtreecommitdiff
path: root/cache.h
diff options
context:
space:
mode:
authorJunio C Hamano <junkio@cox.net>2006-09-27 01:58:57 -0700
committerJunio C Hamano <junkio@cox.net>2006-09-27 02:01:42 -0700
commitac5409e420e5fdd7c4a381f873ffcedfb83d7117 (patch)
treeeae6bec434639c43b324005b5c0b88bfe5889834 /cache.h
parent4431fcc4b134ae501e3e57dc568ae4f031e57898 (diff)
downloadgit-ac5409e420e5fdd7c4a381f873ffcedfb83d7117.tar.gz
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 <oldvalue> still matches the value the caller thought the ref contained. Similarly, it also accepts 0{40} or an empty string as <oldvalue> to allow safe creation of a new ref. Signed-off-by: Junio C Hamano <junkio@cox.net>
Diffstat (limited to 'cache.h')
-rw-r--r--cache.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/cache.h b/cache.h
index 6def155162..6e004505be 100644
--- a/cache.h
+++ b/cache.h
@@ -179,6 +179,7 @@ struct lock_file {
extern int hold_lock_file_for_update(struct lock_file *, const char *path, int);
extern int commit_lock_file(struct lock_file *);
extern void rollback_lock_file(struct lock_file *);
+extern int delete_ref(const char *, unsigned char *sha1);
/* Environment bits from configuration mechanism */
extern int use_legacy_headers;