delete_ref_loose(): inline function
It was hardly doing anything anymore, and had only one caller. Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu> Reviewed-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
parent
0e81d016f1
commit
ce0af24de0
@ -2421,21 +2421,6 @@ static int repack_without_refs(struct files_ref_store *refs,
|
|||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int delete_ref_loose(struct ref_lock *lock, int flag, struct strbuf *err)
|
|
||||||
{
|
|
||||||
assert(err);
|
|
||||||
|
|
||||||
if (!(flag & REF_ISPACKED) || flag & REF_ISSYMREF) {
|
|
||||||
/*
|
|
||||||
* loose. The loose file name is the same as the
|
|
||||||
* lockfile name, minus ".lock":
|
|
||||||
*/
|
|
||||||
if (unlink_or_msg(git_path("%s", lock->ref_name), err))
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
static int files_delete_refs(struct ref_store *ref_store,
|
static int files_delete_refs(struct ref_store *ref_store,
|
||||||
struct string_list *refnames, unsigned int flags)
|
struct string_list *refnames, unsigned int flags)
|
||||||
{
|
{
|
||||||
@ -3788,9 +3773,13 @@ static int files_transaction_commit(struct ref_store *ref_store,
|
|||||||
|
|
||||||
if (update->flags & REF_DELETING &&
|
if (update->flags & REF_DELETING &&
|
||||||
!(update->flags & REF_LOG_ONLY)) {
|
!(update->flags & REF_LOG_ONLY)) {
|
||||||
if (delete_ref_loose(lock, update->type, err)) {
|
if (!(update->type & REF_ISPACKED) ||
|
||||||
ret = TRANSACTION_GENERIC_ERROR;
|
update->type & REF_ISSYMREF) {
|
||||||
goto cleanup;
|
/* It is a loose reference. */
|
||||||
|
if (unlink_or_msg(git_path("%s", lock->ref_name), err)) {
|
||||||
|
ret = TRANSACTION_GENERIC_ERROR;
|
||||||
|
goto cleanup;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!(update->flags & REF_ISPRUNING))
|
if (!(update->flags & REF_ISPRUNING))
|
||||||
|
Loading…
Reference in New Issue
Block a user