File tree Expand file tree Collapse file tree 1 file changed +9
-11
lines changed
Expand file tree Collapse file tree 1 file changed +9
-11
lines changed Original file line number Diff line number Diff line change @@ -2354,21 +2354,19 @@ int git_repository_head_unborn(git_repository *repo)
23542354 return 0 ;
23552355}
23562356
2357- static int at_least_one_cb (const char * refname , void * payload )
2358- {
2359- GIT_UNUSED (refname );
2360- GIT_UNUSED (payload );
2361- return GIT_PASSTHROUGH ;
2362- }
2363-
23642357static int repo_contains_no_reference (git_repository * repo )
23652358{
2366- int error = git_reference_foreach_name (repo , & at_least_one_cb , NULL );
2359+ git_reference_iterator * iter ;
2360+ const char * refname ;
2361+ int error ;
23672362
2368- if (error == GIT_PASSTHROUGH )
2369- return 0 ;
2363+ if (( error = git_reference_iterator_new ( & iter , repo )) < 0 )
2364+ return error ;
23702365
2371- if (!error )
2366+ error = git_reference_next_name (& refname , iter );
2367+ git_reference_iterator_free (iter );
2368+
2369+ if (error == GIT_ITEROVER )
23722370 return 1 ;
23732371
23742372 return error ;
You can’t perform that action at this time.
0 commit comments