1
0
mirror of https://github.com/git/git.git synced 2024-09-24 03:11:22 +02:00
git/builtin
Michael Haggerty 697a41519b parse_arg(): really test that argument is properly terminated
The old parse_arg(), when fed an argument

    "refs/heads/a"master

parsed 'refs/heads/a' off of the front of the argument and considered
itself successful.  It was only when parse_next_arg() tried to parse
the *next* argument that a problem was noticed.  But in fact, the
definition of the input format requires arguments to be terminated by
SP or NUL, so *this* argument is already erroneous and parse_arg()
should diagnose the problem.

So teach parse_arg() to verify that C-quoted arguments are terminated
correctly.  If not, emit a more specific error message.

There is no corresponding error case of a non-C-quoted argument that
is not terminated correctly, because the end of a non-quoted argument
is *by definition* a space or NUL, so there is no way to insert other
junk between the "end" of the argument and the argument terminator.

Adjust the tests to expect the new error message.  Add a docstring to
the function, incorporating the comments that were formerly within the
function plus some added information.

Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2014-04-07 12:09:11 -07:00
..
add.c Merge branch 'fr/add-interactive-argv-array' 2014-03-28 13:51:05 -07:00
annotate.c
apply.c Merge branch 'nd/no-more-fnmatch' 2014-03-14 14:25:31 -07:00
archive.c
bisect--helper.c
blame.c
branch.c
bundle.c
cat-file.c Merge branch 'jk/warn-on-object-refname-ambiguity' 2014-03-25 11:07:36 -07:00
check-attr.c
check-ignore.c
check-mailmap.c
check-ref-format.c
checkout-index.c
checkout.c Merge branch 'bp/commit-p-editor' 2014-03-28 13:51:11 -07:00
clean.c Merge branch 'jk/clean-d-pathspec' 2014-03-18 13:47:57 -07:00
clone.c commit: fix patch hunk editing with "commit -p -m" 2014-03-18 11:25:12 -07:00
column.c
commit-tree.c
commit.c Merge branch 'bp/commit-p-editor' 2014-03-28 13:51:11 -07:00
config.c
count-objects.c
credential.c
describe.c Merge branch 'nd/no-more-fnmatch' 2014-03-14 14:25:31 -07:00
diff-files.c
diff-index.c
diff-tree.c
diff.c
fast-export.c
fetch-pack.c
fetch.c
fmt-merge-msg.c
for-each-ref.c
fsck.c Merge branch 'mh/replace-refs-variable-rename' 2014-03-14 14:27:06 -07:00
gc.c Merge branch 'bp/commit-p-editor' 2014-03-28 13:51:11 -07:00
get-tar-commit-id.c
grep.c
hash-object.c
help.c
index-pack.c Merge branch 'nd/index-pack-error-message' 2014-03-25 11:08:19 -07:00
init-db.c
log.c
ls-files.c
ls-remote.c
ls-tree.c
mailinfo.c
mailsplit.c
merge-base.c
merge-file.c
merge-index.c
merge-ours.c
merge-recursive.c
merge-tree.c
merge.c Merge branch 'bp/commit-p-editor' 2014-03-28 13:51:11 -07:00
mktag.c
mktree.c
mv.c Merge branch 'jk/mv-submodules-fix' 2014-03-25 11:02:02 -07:00
name-rev.c
notes.c Merge branch 'jh/note-trees-record-blobs' 2014-03-14 14:25:39 -07:00
pack-objects.c Merge branch 'jk/pack-bitmap-progress' 2014-03-28 13:50:56 -07:00
pack-redundant.c
pack-refs.c
patch-id.c
prune-packed.c
prune.c Merge branch 'mh/replace-refs-variable-rename' 2014-03-14 14:27:06 -07:00
push.c
read-tree.c
receive-pack.c
reflog.c
remote-ext.c
remote-fd.c
remote.c
repack.c Merge branch 'jk/repack-pack-keep-objects' 2014-03-18 13:50:29 -07:00
replace.c Merge branch 'mh/replace-refs-variable-rename' 2014-03-14 14:27:06 -07:00
rerere.c
reset.c
rev-list.c
rev-parse.c rev-parse --parseopt: option argument name hints 2014-03-23 17:28:03 -07:00
revert.c
rm.c
send-pack.c
shortlog.c
show-branch.c
show-ref.c
stripspace.c
symbolic-ref.c
tag.c Merge branch 'nd/tag-version-sort' 2014-03-21 12:47:39 -07:00
unpack-file.c
unpack-objects.c Merge branch 'mh/replace-refs-variable-rename' 2014-03-14 14:27:06 -07:00
update-index.c
update-ref.c parse_arg(): really test that argument is properly terminated 2014-04-07 12:09:11 -07:00
update-server-info.c
upload-archive.c
var.c
verify-pack.c
verify-tag.c
write-tree.c