]> git.ipfire.org Git - thirdparty/git.git/commit - fast-import.c
fast-import: allow ls or filecopy of the root tree
authorJohn Keeping <john@keeping.me.uk>
Sun, 23 Jun 2013 14:58:21 +0000 (15:58 +0100)
committerJunio C Hamano <gitster@pobox.com>
Sun, 23 Jun 2013 21:22:28 +0000 (14:22 -0700)
commite0eb6b9720db743993d9374e366cb6b7664f0a6d
treeb36a886fcfd79457d61202e5f4f86d92634ca667
parentadefdba536623e23af5d808eea9ec3eba5c55dd6
fast-import: allow ls or filecopy of the root tree

Commit 178e1de (fast-import: don't allow 'ls' of path with empty
components, 2012-03-09) restricted paths which:

    . contain an empty directory component (e.g. foo//bar is invalid),
    . end with a directory separator (e.g. foo/ is invalid),
    . start with a directory separator (e.g. /foo is invalid).

However, the implementation also caught the empty path, which should
represent the root tree.  Relax this restriction so that the empty path
is explicitly allowed and refers to the root tree.

Reported-by: Dave Abrahams <dave@boostpro.com>
Signed-off-by: John Keeping <john@keeping.me.uk>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
fast-import.c
t/t9300-fast-import.sh