rebase: apply cocci patch
authorJunio C Hamano <gitster@pobox.com>
Thu, 1 Nov 2018 12:44:41 +0000 (21:44 +0900)
committerJunio C Hamano <gitster@pobox.com>
Fri, 2 Nov 2018 02:04:59 +0000 (11:04 +0900)
Favor oideq() over !oidcmp() when checking for equality.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin/rebase.c

index d8e4e0e..0ee06aa 100644 (file)
@@ -689,7 +689,7 @@ static int can_fast_forward(struct commit *onto, struct object_id *head_oid,
        merge_bases = get_merge_bases(onto, head);
        if (merge_bases && !merge_bases->next) {
                oidcpy(merge_base, &merge_bases->item->object.oid);
        merge_bases = get_merge_bases(onto, head);
        if (merge_bases && !merge_bases->next) {
                oidcpy(merge_base, &merge_bases->item->object.oid);
-               res = !oidcmp(merge_base, &onto->object.oid);
+               res = oideq(merge_base, &onto->object.oid);
        } else {
                oidcpy(merge_base, &null_oid);
                res = 0;
        } else {
                oidcpy(merge_base, &null_oid);
                res = 0;