Skip to content

Commit adefdba

Browse files
johnkeepinggitster
authored andcommitted
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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent aca7061 commit adefdba

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

fast-import.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3051,6 +3051,8 @@ static void parse_ls(struct branch *b)
30513051
struct object_entry *e = parse_treeish_dataref(&p);
30523052
root = new_tree_entry();
30533053
hashcpy(root->versions[1].sha1, e->idx.sha1);
3054+
if (!is_null_sha1(root->versions[1].sha1))
3055+
root->versions[1].mode = S_IFDIR;
30543056
load_tree(root);
30553057
if (*p++ != ' ')
30563058
die("Missing space after tree-ish: %s", command_buf.buf);

0 commit comments

Comments
 (0)