提交 475d1b33 编写于 作者: S Shawn O. Pearce

Don't allow empty pathnames in fast-import

riddochc on #git noticed corruption caused by import-tars.  This
was fixed in the prior commit by Dscho, but fast-import was wrong
to have allowed a tree to be created with an empty string as the
filename.  No operating system allows this, and Git itself doesn't
accept this into the index.
Signed-off-by: NShawn O. Pearce <spearce@spearce.org>
上级 87859f34
......@@ -1193,6 +1193,8 @@ static int tree_content_set(
n = slash1 - p;
else
n = strlen(p);
if (!n)
die("Empty path component found in input");
for (i = 0; i < t->entry_count; i++) {
e = t->entries[i];
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册