From 8b2f230cd519010d202c57185dc4dc39ca3d53f8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vicent=20Mart=C3=AD?= Date: Thu, 29 Aug 2013 13:27:37 +0200 Subject: [PATCH] repository: Make the is_empty check more explicit --- src/repository.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/repository.c b/src/repository.c index e5f23e4e4..80904d5fa 100644 --- a/src/repository.c +++ b/src/repository.c @@ -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),