]> git.ipfire.org Git - thirdparty/git.git/commitdiff
merge-recursive: use fspathcmp() in path_hashmap_cmp()
authorRené Scharfe <l.s.r@web.de>
Sat, 28 Aug 2021 21:30:49 +0000 (23:30 +0200)
committerJunio C Hamano <gitster@pobox.com>
Mon, 30 Aug 2021 16:44:12 +0000 (09:44 -0700)
Call fspathcmp() instead of open-coding it.  This shortens the code and
makes it less repetitive.

Signed-off-by: René Scharfe <l.s.r@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
merge-recursive.c

index 3355d50e8ad36b8649e26a340c45d456162f03fe..840599fd534f5e88050723bd9cffa34dc578ea82 100644 (file)
@@ -55,10 +55,7 @@ static int path_hashmap_cmp(const void *cmp_data,
        a = container_of(eptr, const struct path_hashmap_entry, e);
        b = container_of(entry_or_key, const struct path_hashmap_entry, e);
 
-       if (ignore_case)
-               return strcasecmp(a->path, key ? key : b->path);
-       else
-               return strcmp(a->path, key ? key : b->path);
+       return fspathcmp(a->path, key ? key : b->path);
 }
 
 /*