@@ -279,7 +279,7 @@ struct ref_dir {
279
279
* presence of an empty subdirectory does not block the creation of a
280
280
* similarly-named reference. (The fact that reference names with the
281
281
* same leading components can conflict *with each other* is a
282
- * separate issue that is regulated by verify_refname_available ().)
282
+ * separate issue that is regulated by verify_refname_available_dir ().)
283
283
*
284
284
* Please note that the name field contains the fully-qualified
285
285
* reference (or subdirectory) name. Space could be saved by only
@@ -911,11 +911,11 @@ static int nonmatching_ref_fn(struct ref_entry *entry, void *vdata)
911
911
*
912
912
* extras and skip must be sorted.
913
913
*/
914
- static int verify_refname_available (const char * refname ,
915
- const struct string_list * extras ,
916
- const struct string_list * skip ,
917
- struct ref_dir * dir ,
918
- struct strbuf * err )
914
+ static int verify_refname_available_dir (const char * refname ,
915
+ const struct string_list * extras ,
916
+ const struct string_list * skip ,
917
+ struct ref_dir * dir ,
918
+ struct strbuf * err )
919
919
{
920
920
const char * slash ;
921
921
int pos ;
@@ -2465,8 +2465,8 @@ static struct ref_lock *lock_ref_sha1_basic(const char *refname,
2465
2465
strbuf_git_path (& orig_ref_file , "%s" , orig_refname );
2466
2466
if (remove_empty_directories (& orig_ref_file )) {
2467
2467
last_errno = errno ;
2468
- if (!verify_refname_available (orig_refname , extras , skip ,
2469
- get_loose_refs (& ref_cache ), err ))
2468
+ if (!verify_refname_available_dir (orig_refname , extras , skip ,
2469
+ get_loose_refs (& ref_cache ), err ))
2470
2470
strbuf_addf (err , "there are still refs under '%s'" ,
2471
2471
orig_refname );
2472
2472
goto error_return ;
@@ -2479,8 +2479,8 @@ static struct ref_lock *lock_ref_sha1_basic(const char *refname,
2479
2479
if (!refname ) {
2480
2480
last_errno = errno ;
2481
2481
if (last_errno != ENOTDIR ||
2482
- !verify_refname_available (orig_refname , extras , skip ,
2483
- get_loose_refs (& ref_cache ), err ))
2482
+ !verify_refname_available_dir (orig_refname , extras , skip ,
2483
+ get_loose_refs (& ref_cache ), err ))
2484
2484
strbuf_addf (err , "unable to resolve reference %s: %s" ,
2485
2485
orig_refname , strerror (last_errno ));
2486
2486
@@ -2493,8 +2493,8 @@ static struct ref_lock *lock_ref_sha1_basic(const char *refname,
2493
2493
* our refname.
2494
2494
*/
2495
2495
if (is_null_oid (& lock -> old_oid ) &&
2496
- verify_refname_available (refname , extras , skip ,
2497
- get_packed_refs (& ref_cache ), err )) {
2496
+ verify_refname_available_dir (refname , extras , skip ,
2497
+ get_packed_refs (& ref_cache ), err )) {
2498
2498
last_errno = ENOTDIR ;
2499
2499
goto error_return ;
2500
2500
}
@@ -3127,10 +3127,10 @@ static int rename_ref_available(const char *oldname, const char *newname)
3127
3127
int ret ;
3128
3128
3129
3129
string_list_insert (& skip , oldname );
3130
- ret = !verify_refname_available (newname , NULL , & skip ,
3131
- get_packed_refs (& ref_cache ), & err )
3132
- && !verify_refname_available (newname , NULL , & skip ,
3133
- get_loose_refs (& ref_cache ), & err );
3130
+ ret = !verify_refname_available_dir (newname , NULL , & skip ,
3131
+ get_packed_refs (& ref_cache ), & err )
3132
+ && !verify_refname_available_dir (newname , NULL , & skip ,
3133
+ get_loose_refs (& ref_cache ), & err );
3134
3134
if (!ret )
3135
3135
error ("%s" , err .buf );
3136
3136
@@ -4376,12 +4376,12 @@ int initial_ref_transaction_commit(struct ref_transaction *transaction,
4376
4376
if ((update -> flags & REF_HAVE_OLD ) &&
4377
4377
!is_null_sha1 (update -> old_sha1 ))
4378
4378
die ("BUG: initial ref transaction with old_sha1 set" );
4379
- if (verify_refname_available (update -> refname ,
4380
- & affected_refnames , NULL ,
4381
- loose_refs , err ) ||
4382
- verify_refname_available (update -> refname ,
4383
- & affected_refnames , NULL ,
4384
- packed_refs , err )) {
4379
+ if (verify_refname_available_dir (update -> refname ,
4380
+ & affected_refnames , NULL ,
4381
+ loose_refs , err ) ||
4382
+ verify_refname_available_dir (update -> refname ,
4383
+ & affected_refnames , NULL ,
4384
+ packed_refs , err )) {
4385
4385
ret = TRANSACTION_NAME_CONFLICT ;
4386
4386
goto cleanup ;
4387
4387
}
0 commit comments