Merge branch 'tg/refs-allowed-flags'
API error-proofing which happens to also squelch warnings from GCC. * tg/refs-allowed-flags: refs: strip out not allowed flags from ref_transaction_update
This commit is contained in:
commit
d019010559
2
refs.c
2
refs.c
@ -939,6 +939,8 @@ int ref_transaction_update(struct ref_transaction *transaction,
|
||||
return -1;
|
||||
}
|
||||
|
||||
flags &= REF_TRANSACTION_UPDATE_ALLOWED_FLAGS;
|
||||
|
||||
flags |= (new_sha1 ? REF_HAVE_NEW : 0) | (old_sha1 ? REF_HAVE_OLD : 0);
|
||||
|
||||
ref_transaction_add_update(transaction, refname, flags,
|
||||
|
8
refs.h
8
refs.h
@ -344,6 +344,14 @@ int refs_pack_refs(struct ref_store *refs, unsigned int flags);
|
||||
#define REF_NODEREF 0x01
|
||||
#define REF_FORCE_CREATE_REFLOG 0x40
|
||||
|
||||
/*
|
||||
* Flags that can be passed in to ref_transaction_update
|
||||
*/
|
||||
#define REF_TRANSACTION_UPDATE_ALLOWED_FLAGS \
|
||||
REF_ISPRUNING | \
|
||||
REF_FORCE_CREATE_REFLOG | \
|
||||
REF_NODEREF
|
||||
|
||||
/*
|
||||
* Setup reflog before using. Fill in err and return -1 on failure.
|
||||
*/
|
||||
|
Loading…
Reference in New Issue
Block a user