summaryrefslogtreecommitdiff
path: root/builtin/tag.c
diff options
context:
space:
mode:
authorJeff King <peff@peff.net>2014-06-19 21:58:10 (GMT)
committerJunio C Hamano <gitster@pobox.com>2014-06-20 17:45:19 (GMT)
commit67a31f612830e79fe768ac886ed9ef7eadd8fb10 (patch)
tree71b4f4ec65f9be778404748baa69736839d6d786 /builtin/tag.c
parent59a642f8ac42c6cd11f63175689aa21b27ce1a6a (diff)
downloadgit-67a31f612830e79fe768ac886ed9ef7eadd8fb10.zip
git-67a31f612830e79fe768ac886ed9ef7eadd8fb10.tar.gz
git-67a31f612830e79fe768ac886ed9ef7eadd8fb10.tar.bz2
http-push: refactor parsing of remote object names
We get loose object names like "objects/??/..." from the remote side, and need to convert them to their hex representation. The code to do so is rather hard to follow, as it uses some calculated lengths whose origins are hard to understand and verify (e.g., the path must be exactly 49 characters long. why? Why doesn't the strcpy overflow obj_hex, which is the same length as path?). We can simplify this a bit by using skip_prefix, using standard 40- and 20-character buffers for hex and binary sha1s, and adding some comments. We also drop a totally bogus comment that claims strlcpy cannot be used because "path" is not NUL-terminated. Right between a call to strlen(path) and strcpy(path). Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin/tag.c')
0 files changed, 0 insertions, 0 deletions