]> granicus.if.org Git - git/commitdiff
merge-recursive: be consistent with assert
authorElijah Newren <newren@gmail.com>
Thu, 15 Aug 2019 21:40:30 +0000 (14:40 -0700)
committerJunio C Hamano <gitster@pobox.com>
Fri, 16 Aug 2019 19:47:20 +0000 (12:47 -0700)
In commit 8daec1df03de ("merge-recursive: switch from (oid,mode) pairs
to a diff_filespec", 2019-04-05), an assertion on a->path && b->path
was added for code readability to document that these both needed to be
non-NULL at this point in the code.  However, the subsequent lines also
read o->path, so it should be included in the assert.

Signed-off-by: Elijah Newren <newren@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
merge-recursive.c

index 6b812d67e3ecd54ece21c2465ede3e28d6fba325..1d960fa64b283c7f1b9d1a538069d43d9a43441d 100644 (file)
@@ -1043,7 +1043,7 @@ static int merge_3way(struct merge_options *opt,
                }
        }
 
-       assert(a->path && b->path);
+       assert(a->path && b->path && o->path);
        if (strcmp(a->path, b->path) ||
            (opt->ancestor != NULL && strcmp(a->path, o->path) != 0)) {
                base_name = opt->ancestor == NULL ? NULL :