]> git.ipfire.org Git - thirdparty/git.git/commit
use xstrncmpz()
authorRené Scharfe <l.s.r@web.de>
Sat, 10 Feb 2024 07:43:01 +0000 (08:43 +0100)
committerJunio C Hamano <gitster@pobox.com>
Mon, 12 Feb 2024 17:32:41 +0000 (09:32 -0800)
commitf0e578c69cd91a554179c09dab6989f6eb0e2910
tree0f0e026d645a86529a80a2237f78329534cd5ba1
parent3526e67d917bcd03f317a058208fa02737654637
use xstrncmpz()

Add and apply a semantic patch for calling xstrncmpz() to compare a
NUL-terminated string with a buffer of a known length instead of using
strncmp() and checking the terminating NUL explicitly.  This simplifies
callers by reducing code duplication.

I had to adjust remote.c manually because Coccinelle inexplicably
changed the indent of the else branches.

Signed-off-by: René Scharfe <l.s.r@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
archive-tar.c
builtin/fast-export.c
builtin/merge.c
builtin/reflog.c
contrib/coccinelle/xstrncmpz.cocci [new file with mode: 0644]
convert.c
merge-ll.c
object.c
remote.c
userdiff.c