Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeff King <peff@peff.net>2020-04-10 22:43:41 +0300
committerJunio C Hamano <gitster@pobox.com>2020-04-11 00:43:36 +0300
commit021ba32a7bca954235e31338c4f27b221a1807de (patch)
tree780c03c2fc873df2a519023a38a3dccd4df81061 /promisor-remote.c
parent9fadedd637b312089337d73c3ed8447e9f0aa775 (diff)
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 'promisor-remote.c')
0 files changed, 0 insertions, 0 deletions