mirror of
https://git.proxmox.com/git/libgit2
synced 2025-05-28 19:47:52 +00:00
repository: Make the is_empty check more explicit
This commit is contained in:
parent
4ab6a759f6
commit
8b2f230cd5
@ -1500,8 +1500,10 @@ int git_repository_is_empty(git_repository *repo)
|
||||
if (git_reference_lookup(&head, repo, GIT_HEAD_FILE) < 0)
|
||||
return -1;
|
||||
|
||||
if (!(error = (git_reference_type(head) == GIT_REF_SYMBOLIC)))
|
||||
if (git_reference_type(head) != GIT_REF_SYMBOLIC) {
|
||||
error = -1;
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
if (!(error = (strcmp(
|
||||
git_reference_symbolic_target(head),
|
||||
|
Loading…
Reference in New Issue
Block a user