Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2022-05-02 19:50:37 +0300
committerJunio C Hamano <gitster@pobox.com>2022-05-02 19:50:37 +0300
commitafe8a9070bc62db9cfde1e30147178c40d391d93 (patch)
treed237acac7915db89829db7da1d0405f2e595a68b /merge-recursive.c
parent7a618493facb79639231f797e492fab51fac2ba4 (diff)
tree-wide: apply equals-null.cocci
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'merge-recursive.c')
-rw-r--r--merge-recursive.c12
1 files changed, 6 insertions, 6 deletions
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;