aboutsummaryrefslogtreecommitdiff
path: root/refs.h
diff options
context:
space:
mode:
authorRonnie Sahlberg <sahlberg@google.com>2014-04-30 09:03:36 -0700
committerJunio C Hamano <gitster@pobox.com>2014-09-03 10:04:18 -0700
commit029cdb4ab21c49a916efd68eaf2d2431c7fab7c7 (patch)
tree29082e54c8188c97df156d250cd2b1cd6d364081 /refs.h
parentcba12021c3c932e42de838d0fc05d60b93790599 (diff)
downloadgit-029cdb4ab21c49a916efd68eaf2d2431c7fab7c7.tar.gz
git-029cdb4ab21c49a916efd68eaf2d2431c7fab7c7.tar.xz
refs.c: make prune_ref use a transaction to delete the ref
Change prune_ref to delete the ref using a ref transaction. To do this we also need to add a new flag REF_ISPRUNING that will tell the transaction that we do not want to delete this ref from the packed refs. This flag is private to refs.c and not exposed to external callers. Signed-off-by: Ronnie Sahlberg <sahlberg@google.com> Reviewed-by: Michael Haggerty <mhagger@alum.mit.edu> Signed-off-by: Jonathan Nieder <jrnieder@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'refs.h')
-rw-r--r--refs.h13
1 files changed, 11 insertions, 2 deletions
diff --git a/refs.h b/refs.h
index 65dd593f7..69ef28c80 100644
--- a/refs.h
+++ b/refs.h
@@ -170,9 +170,18 @@ extern int ref_exists(const char *);
*/
extern int peel_ref(const char *refname, unsigned char *sha1);
-/** Locks any ref (for 'HEAD' type refs). */
+/*
+ * Flags controlling lock_any_ref_for_update(), ref_transaction_update(),
+ * ref_transaction_create(), etc.
+ * REF_NODEREF: act on the ref directly, instead of dereferencing
+ * symbolic references.
+ *
+ * Flags >= 0x100 are reserved for internal use.
+ */
#define REF_NODEREF 0x01
-/* errno is set to something meaningful on failure */
+/*
+ * This function sets errno to something meaningful on failure.
+ */
extern struct ref_lock *lock_any_ref_for_update(const char *refname,
const unsigned char *old_sha1,
int flags, int *type_p);