]> git.ipfire.org Git - thirdparty/git.git/commit - fast-import.c
fast-import: check committer name more strictly
authorDmitry Ivankov <divanorama@gmail.com>
Thu, 11 Aug 2011 10:21:08 +0000 (16:21 +0600)
committerJunio C Hamano <gitster@pobox.com>
Thu, 11 Aug 2011 19:21:03 +0000 (12:21 -0700)
commit4b4963c0e1aa094900951df9e66459443111ccc9
treeee610335e665fab5ecd99a2e7ff6723c5f48ea69
parent17fb00721b854b1c469e44ad709a9cad2128f11d
fast-import: check committer name more strictly

The documentation declares following identity format:
(<name> SP)? LT <email> GT
where name is any string without LF and LT characters.
But fast-import just accepts any string up to first GT
instead of checking the whole format, and moreover just
writes it as is to the commit object.

git-fsck checks for [^<\n]* <[^<>\n]*> format. Note that the
space is mandatory. And the space quirk is already handled via
extending the string to the left when needed.

Modify fast-import input identity format to a slightly stricter
one - deny LF, LT and GT in both <name> and <email>. And check
for it.

This is stricter then git-fsck as fsck accepts "Name> <email>"
currently, but soon fsck check will be adjusted likewise.

Signed-off-by: Dmitry Ivankov <divanorama@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Documentation/git-fast-import.txt
fast-import.c
t/t9300-fast-import.sh