Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 9146f1e

Browse files
committed
repository: clarify assignment and test order
1 parent 3517331 commit 9146f1e

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/repository.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1500,12 +1500,12 @@ int git_repository_is_empty(git_repository *repo)
15001500
if (git_reference_lookup(&head, repo, GIT_HEAD_FILE) < 0)
15011501
return -1;
15021502

1503-
if (!(error = git_reference_type(head) == GIT_REF_SYMBOLIC))
1503+
if (!((error = git_reference_type(head)) == GIT_REF_SYMBOLIC))
15041504
goto cleanup;
15051505

1506-
if (!(error = strcmp(
1506+
if (!(error = (strcmp(
15071507
git_reference_symbolic_target(head),
1508-
GIT_REFS_HEADS_DIR "master") == 0))
1508+
GIT_REFS_HEADS_DIR "master") == 0)))
15091509
goto cleanup;
15101510

15111511
error = repo_contains_no_reference(repo);

0 commit comments

Comments
 (0)