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>

Michael Haggerty committed Jan 6, 2017 at 17:22 UTC ce0af24de01114552e37ec87dbb948013454f3e1
1 file changed +7 -18
refs/files-backend.c
+7 -18
@@ -2421,21 +2421,6 @@ static int repack_without_refs(struct files_ref_store *refs,
2421 return ret;
2422 }
2423
2424 -static int delete_ref_loose(struct ref_lock *lock, int flag, struct strbuf *err)
2425 -{
2426 - assert(err);
2427 -
2428 - if (!(flag & REF_ISPACKED) || flag & REF_ISSYMREF) {
2429 - /*
2430 - * loose. The loose file name is the same as the
2431 - * lockfile name, minus ".lock":
2432 - */
2433 - if (unlink_or_msg(git_path("%s", lock->ref_name), err))
2434 - return 1;
2435 - }
2436 - return 0;
2437 -}
2438 -
2424 static int files_delete_refs(struct ref_store *ref_store,
2425 struct string_list *refnames, unsigned int flags)
2426 {
@@ -3788,9 +3773,13 @@ static int files_transaction_commit(struct ref_store *ref_store,
3773
3774 if (update->flags & REF_DELETING &&
3775 !(update->flags & REF_LOG_ONLY)) {
3791 - if (delete_ref_loose(lock, update->type, err)) {
3792 - ret = TRANSACTION_GENERIC_ERROR;
3793 - goto cleanup;
3776 + if (!(update->type & REF_ISPACKED) ||
3777 + update->type & REF_ISSYMREF) {
3778 + /* It is a loose reference. */
3779 + if (unlink_or_msg(git_path("%s", lock->ref_name), err)) {
3780 + ret = TRANSACTION_GENERIC_ERROR;
3781 + goto cleanup;
3782 + }
3783 }
3784
3785 if (!(update->flags & REF_ISPRUNING))