summaryrefslogtreecommitdiff
path: root/strbuf.c
diff options
context:
space:
mode:
authorLibravatar Jeff King <peff@peff.net>2017-11-12 10:27:39 +0000
committerLibravatar Junio C Hamano <gitster@pobox.com>2017-11-13 14:05:27 +0900
commitf28e36686aae9203c0e4375f6d106ddccd129efc (patch)
tree680acb4959c00784509cdf61133f975e6b4dc83d /strbuf.c
parentread_info_alternates: warn on non-trivial errors (diff)
downloadtgif-f28e36686aae9203c0e4375f6d106ddccd129efc.tar.xz
link_alt_odb_entries: make empty input a noop
If an empty string is passed to link_alt_odb_entries(), our loop finds no entries and we link nothing. But we still do some preparatory work to normalize the object directory path, even though we'll never look at the result. This triggers in basically every git process, since we feed the usually-empty ALTERNATE_DB_ENVIRONMENT to the function. Let's detect early that there's nothing to do and return. While we're at it, let's treat NULL the same as an empty string as a favor to our callers. That saves prepare_alt_odb() from having to cover this case. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'strbuf.c')
0 files changed, 0 insertions, 0 deletions