diff options
author | Jeff King <peff@peff.net> | 2015-09-24 17:07:20 -0400 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2015-09-25 10:18:18 -0700 |
commit | 0e265a92a1d2b9275d638f696c65c9bbe747e78c (patch) | |
tree | 893e58c8703da8c4f4785853a5994622be17d488 /trace.h | |
parent | f28e3ab231d36c454445fe778ffb931920606109 (diff) | |
download | git-0e265a92a1d2b9275d638f696c65c9bbe747e78c.tar.gz git-0e265a92a1d2b9275d638f696c65c9bbe747e78c.tar.xz |
read_remotes_file: simplify string handling
The main motivation for this cleanup is to switch our
line-reading to a strbuf, which removes the use of a
fixed-size buffer (which limited the size of remote URLs).
Since we have the strbuf, we can make use of strbuf_rtrim().
While we're here, we can also simplify the parsing of each
line. First, we can use skip_prefix() to avoid some magic
numbers.
But second, we can avoid splitting the parsing and actions
for each line into two stages. Right now we figure out which
type of line we have, set an int to a magic number,
skip any intermediate whitespace, and then act on
the resulting value based on the magic number.
Instead, let's factor the whitespace skipping into a
function. That lets us avoid the magic numbers and keep the
actions close to the parsing.
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'trace.h')
0 files changed, 0 insertions, 0 deletions