Merge branch 'mh/packed-ref-store' into next
authorJunio C Hamano <gitster@pobox.com>
Fri, 18 Aug 2017 20:52:47 +0000 (13:52 -0700)
committerJunio C Hamano <gitster@pobox.com>
Fri, 18 Aug 2017 20:52:48 +0000 (13:52 -0700)
The "ref-store" code reorganization continues.

* mh/packed-ref-store:
files-backend: cheapen refname_available check when locking refs

1  2 
refs/files-backend.c
diff --combined refs/files-backend.c
index 928a655a27bab5ae6cce7e1f8f8c3ee7145e1a48,f2a420c6118fb2bf4e3514ea544fae17896e51d6..5cca55510b6a0683f16937215f6056d896c622e0
@@@ -1,5 -1,4 +1,5 @@@
  #include "../cache.h"
 +#include "../config.h"
  #include "../refs.h"
  #include "refs-internal.h"
  #include "ref-cache.h"
@@@ -632,11 -631,11 +632,11 @@@ retry
  
                /*
                 * If the ref did not exist and we are creating it,
-                * make sure there is no existing ref that conflicts
-                * with refname:
+                * make sure there is no existing packed ref that
+                * conflicts with refname:
                 */
                if (refs_verify_refname_available(
-                                   &refs->base, refname,
+                                   refs->packed_ref_store, refname,
                                    extras, skip, err))
                        goto error_return;
        }
@@@ -939,7 -938,7 +939,7 @@@ static struct ref_lock *lock_ref_sha1_b
         * our refname.
         */
        if (is_null_oid(&lock->old_oid) &&
-           refs_verify_refname_available(&refs->base, refname,
+           refs_verify_refname_available(refs->packed_ref_store, refname,
                                          extras, skip, err)) {
                last_errno = ENOTDIR;
                goto error_return;
@@@ -2465,7 -2464,8 +2465,7 @@@ static int files_transaction_prepare(st
                                       head_oid.hash, &head_type);
  
        if (head_ref && !(head_type & REF_ISSYMREF)) {
 -              free(head_ref);
 -              head_ref = NULL;
 +              FREE_AND_NULL(head_ref);
        }
  
        /*