]> git.ipfire.org Git - thirdparty/git.git/commit
fetch_bundle_uri(): drop pointless NULL check
authorJeff King <peff@peff.net>
Sat, 22 Apr 2023 13:56:46 +0000 (09:56 -0400)
committerJunio C Hamano <gitster@pobox.com>
Mon, 24 Apr 2023 18:09:16 +0000 (11:09 -0700)
commit0b1a95ef793716e7e51caf929b971ee2cbf4116d
treedf976d432483786899de5b15c2292efaf7169fa1
parentae6f064fd7f0925cc8985769750a1367a4c24194
fetch_bundle_uri(): drop pointless NULL check

We check if "uri" is NULL, but it cannot be since we'd have segfaulted
earlier in the function when we unconditionally called xstrdup() on it.

In theory we might want to soften that xstrdup() to handle this case,
but even before the code which added it via c23f592117 (bundle-uri:
fetch a list of bundles, 2022-10-12), we'd have fed NULL to
fetch_bundle_uri_internal(), which would also segfault.

The extra check isn't hurting anything, but it does cause Coverity to
complain, and it may mislead somebody reading the code into thinking
that a NULL uri is something we're prepared to handle.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
bundle-uri.c