summaryrefslogtreecommitdiff
path: root/fast-import.c
diff options
context:
space:
mode:
authorJohn Keeping <john@keeping.me.uk>2013-06-23 15:58:20 +0100
committerJunio C Hamano <gitster@pobox.com>2013-06-23 14:22:28 -0700
commitadefdba536623e23af5d808eea9ec3eba5c55dd6 (patch)
tree71029810e4dde15d5605b047191158ec061662c0 /fast-import.c
parentaca70610b6dea395995790c2eda58535d4cbe12e (diff)
downloadgit-adefdba536623e23af5d808eea9ec3eba5c55dd6.tar.gz
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>
Diffstat (limited to 'fast-import.c')
-rw-r--r--fast-import.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/fast-import.c b/fast-import.c
index 5f539d7d8f..ea1b3217fe 100644
--- a/fast-import.c
+++ b/fast-import.c
@@ -3051,6 +3051,8 @@ static void parse_ls(struct branch *b)
struct object_entry *e = parse_treeish_dataref(&p);
root = new_tree_entry();
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);
if (*p++ != ' ')
die("Missing space after tree-ish: %s", command_buf.buf);