Skip to content

Commit 7e44d80

Browse files
committed
Merge branch 'mr/packed-ref-store-fix' into maint
Crash fix for a corner case where an error codepath tried to unlock what it did not acquire lock on. * mr/packed-ref-store-fix: files_initial_transaction_commit(): only unlock if locked
2 parents 721dce0 + 81fcb69 commit 7e44d80

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

refs/files-backend.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2931,13 +2931,12 @@ static int files_initial_transaction_commit(struct ref_store *ref_store,
29312931

29322932
if (initial_ref_transaction_commit(packed_transaction, err)) {
29332933
ret = TRANSACTION_GENERIC_ERROR;
2934-
goto cleanup;
29352934
}
29362935

2936+
packed_refs_unlock(refs->packed_ref_store);
29372937
cleanup:
29382938
if (packed_transaction)
29392939
ref_transaction_free(packed_transaction);
2940-
packed_refs_unlock(refs->packed_ref_store);
29412940
transaction->state = REF_TRANSACTION_CLOSED;
29422941
string_list_clear(&affected_refnames, 0);
29432942
return ret;

0 commit comments

Comments
 (0)