fast-import: set valid mode on root tree in "ls"

This prevents a failure later when we lift the restriction on ls with the empty path. Signed-off-by: John Keeping <john@keeping.me.uk> Signed-off-by: Junio C Hamano <gitster@pobox.com>

John Keeping committed Jun 23, 2013 at 15:58 UTC adefdba536623e23af5d808eea9ec3eba5c55dd6
1 file changed +2
fast-import.c
+2
@@ -3051,6 +3051,8 @@ static void parse_ls(struct branch *b)
3051 struct object_entry *e = parse_treeish_dataref(&p);
3052 root = new_tree_entry();
3053 hashcpy(root->versions[1].sha1, e->idx.sha1);
3054 + if (!is_null_sha1(root->versions[1].sha1))
3055 + root->versions[1].mode = S_IFDIR;
3056 load_tree(root);
3057 if (*p++ != ' ')
3058 die("Missing space after tree-ish: %s", command_buf.buf);