summaryrefslogtreecommitdiff
path: root/builtin/gc.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2022-05-02 16:50:37 (GMT)
committerJunio C Hamano <gitster@pobox.com>2022-05-02 16:50:37 (GMT)
commitafe8a9070bc62db9cfde1e30147178c40d391d93 (patch)
treed237acac7915db89829db7da1d0405f2e595a68b /builtin/gc.c
parent7a618493facb79639231f797e492fab51fac2ba4 (diff)
downloadgit-afe8a9070bc62db9cfde1e30147178c40d391d93.zip
git-afe8a9070bc62db9cfde1e30147178c40d391d93.tar.gz
git-afe8a9070bc62db9cfde1e30147178c40d391d93.tar.bz2
tree-wide: apply equals-null.cocci
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin/gc.c')
-rw-r--r--builtin/gc.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/builtin/gc.c b/builtin/gc.c
index bcef6a4..48a0504 100644
--- a/builtin/gc.c
+++ b/builtin/gc.c
@@ -446,7 +446,7 @@ static const char *lock_repo_for_gc(int force, pid_t* ret_pid)
fscanf(fp, scan_fmt, &pid, locking_host) == 2 &&
/* be gentle to concurrent "gc" on remote hosts */
(strcmp(locking_host, my_host) || !kill(pid, 0) || errno == EPERM);
- if (fp != NULL)
+ if (fp)
fclose(fp);
if (should_exit) {
if (fd >= 0)
@@ -2236,7 +2236,7 @@ static int systemd_timer_write_unit_templates(const char *exec_path)
goto error;
}
file = fopen_or_warn(filename, "w");
- if (file == NULL)
+ if (!file)
goto error;
unit = "# This file was created and is maintained by Git.\n"
@@ -2265,7 +2265,7 @@ static int systemd_timer_write_unit_templates(const char *exec_path)
filename = xdg_config_home_systemd("git-maintenance@.service");
file = fopen_or_warn(filename, "w");
- if (file == NULL)
+ if (!file)
goto error;
unit = "# This file was created and is maintained by Git.\n"