X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=fast-import.c;h=77549ebd6fbfbea051901d4ab474eebc8e2dbdbd;hb=6ee4a9be48ee714ddacf313a7073dabdd6c6ee11;hp=2317b0fe7509b957577234890135509143c0872b;hpb=8ac8cf5bc17ef11a9c5d51ab128ad010cb37c464;p=git.git diff --git a/fast-import.c b/fast-import.c index 2317b0fe7..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) @@ -2884,7 +2893,7 @@ static int git_pack_config(const char *k, const char *v, void *cb) } static const char fast_import_usage[] = -"git fast-import [--date-format=f] [--max-pack-size=n] [--big-file-threshold=n] [--depth=n] [--active-branches=n] [--export-marks=marks.file]"; +"git fast-import [--date-format=] [--max-pack-size=] [--big-file-threshold=] [--depth=] [--active-branches=] [--export-marks=]"; static void parse_argv(void) {