Unverified Commit ac77d306 by Edward Thomson Committed by GitHub

Merge pull request #5834 from libgit2/cmn/repo-no-passthrough

repo: remove an inappropriate use of PASSTHROUGH
parents d05eda87 6591deef
...@@ -2354,21 +2354,19 @@ int git_repository_head_unborn(git_repository *repo) ...@@ -2354,21 +2354,19 @@ int git_repository_head_unborn(git_repository *repo)
return 0; return 0;
} }
static int at_least_one_cb(const char *refname, void *payload)
{
GIT_UNUSED(refname);
GIT_UNUSED(payload);
return GIT_PASSTHROUGH;
}
static int repo_contains_no_reference(git_repository *repo) static int repo_contains_no_reference(git_repository *repo)
{ {
int error = git_reference_foreach_name(repo, &at_least_one_cb, NULL); git_reference_iterator *iter;
const char *refname;
int error;
if (error == GIT_PASSTHROUGH) if ((error = git_reference_iterator_new(&iter, repo)) < 0)
return 0; return error;
if (!error) error = git_reference_next_name(&refname, iter);
git_reference_iterator_free(iter);
if (error == GIT_ITEROVER)
return 1; return 1;
return error; return error;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment