summaryrefslogtreecommitdiff
path: root/config.c
diff options
context:
space:
mode:
authorLibravatar Jeff King <peff@peff.net>2020-04-10 15:43:41 -0400
committerLibravatar Junio C Hamano <gitster@pobox.com>2020-04-10 14:43:36 -0700
commit021ba32a7bca954235e31338c4f27b221a1807de (patch)
tree780c03c2fc873df2a519023a38a3dccd4df81061 /config.c
parentMerge branch 'ds/default-pack-use-sparse-to-true' (diff)
downloadtgif-021ba32a7bca954235e31338c4f27b221a1807de.tar.xz
remote: drop auto-strlen behavior of make_branch() and make_rewrite()
The make_branch() and make_rewrite() functions can take a NUL-terminated string or a ptr/len pair. They use a sentinel value of "0" for the len to tell the difference between the two. However, when parsing config like: [branch ""] merge = whatever whose key flattens to: branch..merge we might actually have a zero-length branch name. This is obviously nonsense, but the current code would consider it as a NUL-terminated string and use the branch name ".merge". We could use a better sentinel value here (like "-1"), but that gets in the way of moving to size_t, which is a more appropriate type for a ptr/len combo. Let's instead just drop this feature and have the callers (of which there are only two total) use strlen() themselves. This simplifies the code, and lets us move to using size_t. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'config.c')
0 files changed, 0 insertions, 0 deletions