From fb93232931569cb6386d1150486b9e12c28f0678 Mon Sep 17 00:00:00 2001 From: Berthold Stoeger Date: Tue, 22 Sep 2020 21:15:55 +0200 Subject: 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 --- core/git-access.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'core') 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 -- cgit v1.2.3-70-g09d2