From afe8a9070bc62db9cfde1e30147178c40d391d93 Mon Sep 17 00:00:00 2001 From: Junio C Hamano Date: Mon, 2 May 2022 09:50:37 -0700 Subject: tree-wide: apply equals-null.cocci Signed-off-by: Junio C Hamano --- merge-recursive.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'merge-recursive.c') diff --git a/merge-recursive.c b/merge-recursive.c index d9457797db..543a7caa15 100644 --- a/merge-recursive.c +++ b/merge-recursive.c @@ -82,7 +82,7 @@ static struct dir_rename_entry *dir_rename_find_entry(struct hashmap *hashmap, { struct dir_rename_entry key; - if (dir == NULL) + if (!dir) return NULL; hashmap_entry_init(&key.ent, strhash(dir)); key.dir = dir; @@ -1987,14 +1987,14 @@ static void get_renamed_dir_portion(const char *old_path, const char *new_path, * renamed means the root directory can never be renamed -- because * the root directory always exists). */ - if (end_of_old == NULL) + if (!end_of_old) return; /* Note: *old_dir and *new_dir are still NULL */ /* * If new_path contains no directory (end_of_new is NULL), then we * have a rename of old_path's directory to the root directory. */ - if (end_of_new == NULL) { + if (!end_of_new) { *old_dir = xstrndup(old_path, end_of_old - old_path); *new_dir = xstrdup(""); return; @@ -2113,7 +2113,7 @@ static char *handle_path_level_conflicts(struct merge_options *opt, * to ensure that's the case. */ collision_ent = collision_find_entry(collisions, new_path); - if (collision_ent == NULL) + if (!collision_ent) BUG("collision_ent is NULL"); /* @@ -2993,7 +2993,7 @@ static void final_cleanup_rename(struct string_list *rename) const struct rename *re; int i; - if (rename == NULL) + if (!rename) return; for (i = 0; i < rename->nr; i++) { @@ -3602,7 +3602,7 @@ static int merge_recursive_internal(struct merge_options *opt, } merged_merge_bases = pop_commit(&merge_bases); - if (merged_merge_bases == NULL) { + if (!merged_merge_bases) { /* if there is no common ancestor, use an empty tree */ struct tree *tree; -- cgit v1.2.3