t/3512: demonstrate unrelated submodule/file conflict as cherry-pick failure
[gitweb.git] / refs / files-backend.c
index 1b6141e718a5c449226c22fdeefb80b591ca3f7e..8cc1e07fdb7204d13c99826304317c66d4249cf5 100644 (file)
@@ -2494,7 +2494,6 @@ static int files_transaction_prepare(struct ref_store *ref_store,
        struct string_list affected_refnames = STRING_LIST_INIT_NODUP;
        char *head_ref = NULL;
        int head_type;
-       struct object_id head_oid;
        struct files_transaction_backend_data *backend_data;
        struct ref_transaction *packed_transaction = NULL;
 
@@ -2551,7 +2550,7 @@ static int files_transaction_prepare(struct ref_store *ref_store,
         */
        head_ref = refs_resolve_refdup(ref_store, "HEAD",
                                       RESOLVE_REF_NO_RECURSE,
-                                      head_oid.hash, &head_type);
+                                      NULL, &head_type);
 
        if (head_ref && !(head_type & REF_ISSYMREF)) {
                FREE_AND_NULL(head_ref);
@@ -2571,7 +2570,7 @@ static int files_transaction_prepare(struct ref_store *ref_store,
                ret = lock_ref_for_update(refs, update, transaction,
                                          head_ref, &affected_refnames, err);
                if (ret)
-                       break;
+                       goto cleanup;
 
                if (update->flags & REF_DELETING &&
                    !(update->flags & REF_LOG_ONLY) &&