X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;ds=sidebyside;f=fast-import.c;h=77549ebd6fbfbea051901d4ab474eebc8e2dbdbd;hb=79c461d5b1139afa3d3997c7ef9ee521562b2a1a;hp=eab68d58c394a67f4805d77b0007b583e79e24b9;hpb=62b4698e551c29b3d2539a764ad0e93cfff53c03;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)