summaryrefslogtreecommitdiff
path: root/git-bisect.sh
diff options
context:
space:
mode:
authorJeff King <peff@peff.net>2015-09-24 17:07:18 -0400
committerJunio C Hamano <gitster@pobox.com>2015-09-25 10:18:18 -0700
commitf28e3ab231d36c454445fe778ffb931920606109 (patch)
tree608a7c9b193037216575ecd3f7addd5845864180 /git-bisect.sh
parentc978610dc841efe300bf4d1ee61b24d78b13c4f4 (diff)
downloadgit-f28e3ab231d36c454445fe778ffb931920606109.tar.gz
read_branches_file: simplify string handling
This function does a lot of manual string handling, and has some unnecessary limits. This patch cleans up a number of things: 1. Drop the arbitrary 1000-byte limit on the size of the remote name (we do not have such a limit in any of the other remote-reading mechanisms). 2. Replace fgets into a fixed-size buffer with a strbuf, eliminating any limits on the length of the URL. 3. Replace manual whitespace handling with strbuf_trim (since we now have a strbuf). This also gets rid of a call to strcpy, and the confusing reuse of the "p" pointer for multiple purposes. 4. We currently build up the refspecs over multiple strbuf calls. We do this to handle the fact that the URL "frag" may not be present. But rather than have multiple conditionals, let's just default "frag" to "master". This lets us format the refspecs with a single xstrfmt. It's shorter, and easier to see what the final string looks like. We also update the misleading comment in this area (the local branch is named after the remote name, not after the branch name on the remote side). Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'git-bisect.sh')
0 files changed, 0 insertions, 0 deletions