refs: move REF_DELETING to refs.c

It is only used internally now. Document it a little bit better, too.

Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Reviewed-by: Stefan Beller <sbeller@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
Michael Haggerty 2015-02-12 12:12:12 +01:00 committed by Junio C Hamano
parent 18d0fec240
commit 581d4e0cdb
2 changed files with 7 additions and 3 deletions

6
refs.c
View File

@ -34,6 +34,12 @@ static unsigned char refname_disposition[256] = {
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 4, 4 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 4, 4
}; };
/*
* Flag passed to lock_ref_sha1_basic() telling it to tolerate broken
* refs (i.e., because the reference is about to be deleted anyway).
*/
#define REF_DELETING 0x02
/* /*
* Used as a flag to ref_transaction_delete when a loose ref is being * Used as a flag to ref_transaction_delete when a loose ref is being
* pruned. * pruned.

4
refs.h
View File

@ -183,12 +183,10 @@ extern int peel_ref(const char *refname, unsigned char *sha1);
* Flags controlling ref_transaction_update(), ref_transaction_create(), etc. * Flags controlling ref_transaction_update(), ref_transaction_create(), etc.
* REF_NODEREF: act on the ref directly, instead of dereferencing * REF_NODEREF: act on the ref directly, instead of dereferencing
* symbolic references. * symbolic references.
* REF_DELETING: tolerate broken refs
* *
* Flags >= 0x100 are reserved for internal use. * Other flags are reserved for internal use.
*/ */
#define REF_NODEREF 0x01 #define REF_NODEREF 0x01
#define REF_DELETING 0x02
/* /*
* Setup reflog before using. Set errno to something meaningful on failure. * Setup reflog before using. Set errno to something meaningful on failure.