aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Berthold Stoeger <bstoeger@mail.tuwien.ac.at>2020-09-22 21:15:55 +0200
committerGravatar Dirk Hohndel <dirk@hohndel.org>2020-09-22 14:10:12 -0700
commitfb93232931569cb6386d1150486b9e12c28f0678 (patch)
tree564ef25791c220cbf04ae8b10c4a0905b827f919
parent9d3b15bf9cb758e9f371d5f5f9eec0a3a2b0a4e2 (diff)
downloadsubsurface-fb93232931569cb6386d1150486b9e12c28f0678.tar.gz
cleanup: silence two compiler warnings in git-access.c
gcc complained about two constructs of the kind remote_id && SSRF_INFO("..."); And while I am not a fan of excessive warnings, I must say it has a point here. That's just code obfuscation. In fact, it appears that the condition was wrong - the SSRF_INFO should probably be invoked if remote_id is NULL. The way it was written it would be invoked if it was *not* NULL. Change both instances to unfancy if statements. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
-rw-r--r--core/git-access.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/core/git-access.c b/core/git-access.c
index be1f39120..891ecf1e2 100644
--- a/core/git-access.c
+++ b/core/git-access.c
@@ -505,8 +505,10 @@ static int try_to_update(git_repository *repo, git_remote *origin, git_reference
remote_id = git_reference_target(remote);
if (!local_id || !remote_id) {
- local_id && SSRF_INFO("git storage: unable to get local SHA");
- remote_id && SSRF_INFO("git storage: unable to get remote SHA");
+ if (!local_id)
+ SSRF_INFO("git storage: unable to get local SHA");
+ if (!remote_id)
+ SSRF_INFO("git storage: unable to get remote SHA");
if (is_subsurface_cloud)
goto cloud_data_error;
else