Commit 9146f1e57ec4f2b6fa293c78d54f1383464ff5be

Rémi Duraffort 2013-07-15T15:59:18

repository: clarify assignment and test order

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
diff --git a/src/repository.c b/src/repository.c
index bd7ef54..99ac56e 100644
--- a/src/repository.c
+++ b/src/repository.c
@@ -1500,12 +1500,12 @@ 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 (!((error = git_reference_type(head)) == GIT_REF_SYMBOLIC))
 		goto cleanup;
 
-	if (!(error = strcmp(
+	if (!(error = (strcmp(
 		git_reference_symbolic_target(head),
-		GIT_REFS_HEADS_DIR "master") == 0))
+		GIT_REFS_HEADS_DIR "master") == 0)))
 			goto cleanup;
 
 	error = repo_contains_no_reference(repo);