mirror of
https://github.com/git/git
synced 2024-08-27 19:49:21 +00:00
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>
This commit is contained in:
parent
aca70610b6
commit
adefdba536
|
@ -3051,6 +3051,8 @@ static void parse_ls(struct branch *b)
|
||||||
struct object_entry *e = parse_treeish_dataref(&p);
|
struct object_entry *e = parse_treeish_dataref(&p);
|
||||||
root = new_tree_entry();
|
root = new_tree_entry();
|
||||||
hashcpy(root->versions[1].sha1, e->idx.sha1);
|
hashcpy(root->versions[1].sha1, e->idx.sha1);
|
||||||
|
if (!is_null_sha1(root->versions[1].sha1))
|
||||||
|
root->versions[1].mode = S_IFDIR;
|
||||||
load_tree(root);
|
load_tree(root);
|
||||||
if (*p++ != ' ')
|
if (*p++ != ' ')
|
||||||
die("Missing space after tree-ish: %s", command_buf.buf);
|
die("Missing space after tree-ish: %s", command_buf.buf);
|
||||||
|
|
Loading…
Reference in a new issue