diff options
author | Jeff King <peff@peff.net> | 2014-06-18 15:51:57 -0400 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2014-06-20 10:45:19 -0700 |
commit | e814c39c2fe7cc915ba70c0aa6f03156a28920fc (patch) | |
tree | 0f84a280e06c7b0b030d13dc9587a9e2cec99245 /t/t5002-archive-attr-pattern.sh | |
parent | stat_opt: check extra strlen call (diff) | |
download | tgif-e814c39c2fe7cc915ba70c0aa6f03156a28920fc.tar.xz |
fast-import: refactor parsing of spaces
When we see a file change in a commit, we expect one of:
1. A mark.
2. An "inline" keyword.
3. An object sha1.
The handling of spaces is inconsistent between the three
options. Option 1 calls a sub-function which checks for the
space, but doesn't parse past it. Option 2 parses the space,
then deliberately avoids moving the pointer past it. Option
3 detects the space locally but doesn't move past it.
This is confusing, because it looks like option 1 forgets to
check for the space (it's just buried). And option 2 checks
for "inline ", but only moves strlen("inline") characters
forward, which looks like a bug but isn't.
We can make this more clear by just having each branch move
past the space as it is checked (and we can replace the
doubled use of "inline" with a call to skip_prefix).
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t5002-archive-attr-pattern.sh')
0 files changed, 0 insertions, 0 deletions