X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=fast-import.c;h=77549ebd6fbfbea051901d4ab474eebc8e2dbdbd;hb=18e051a3981f38db08521bb61ccf7e4571335353;hp=eab68d58c394a67f4805d77b0007b583e79e24b9;hpb=f7bff60de95951d2c82601350cb3771b347e83ee;p=git.git diff --git a/fast-import.c b/fast-import.c index eab68d58c..77549ebd6 100644 --- a/fast-import.c +++ b/fast-import.c @@ -1454,6 +1454,15 @@ static int tree_content_set( n = slash1 - p; else n = strlen(p); + if (!slash1 && !n) { + if (!S_ISDIR(mode)) + die("Root cannot be a non-directory"); + hashcpy(root->versions[1].sha1, sha1); + if (root->tree) + release_tree_content_recursive(root->tree); + root->tree = subtree; + return 1; + } if (!n) die("Empty path component found in input"); if (!slash1 && !S_ISDIR(mode) && subtree)