fast-export: Do parent rewriting to avoid dropping relevant commits
[gitweb.git] / builtin-clone.c
index d068b7e0d89399ac54c2cf56f128d8884e20b665..2ceacb7b3f34c78e64ed047833d8af5a061f065f 100644 (file)
@@ -141,7 +141,7 @@ static char *guess_dir_name(const char *repo, int is_bundle, int is_bare)
        if (is_bare) {
                struct strbuf result = STRBUF_INIT;
                strbuf_addf(&result, "%.*s.git", (int)(end - start), start);
-               dir = strbuf_detach(&result, 0);
+               dir = strbuf_detach(&result, NULL);
        } else
                dir = xstrndup(start, end - start);
        /*
@@ -252,7 +252,8 @@ static void copy_or_link_directory(struct strbuf *src, struct strbuf *dest)
                }
 
                if (unlink(dest->buf) && errno != ENOENT)
-                       die("failed to unlink %s", dest->buf);
+                       die("failed to unlink %s: %s",
+                           dest->buf, strerror(errno));
                if (!option_no_hardlinks) {
                        if (!link(src->buf, dest->buf))
                                continue;
@@ -359,7 +360,7 @@ int cmd_clone(int argc, const char **argv, const char *prefix)
 
        junk_pid = getpid();
 
-       argc = parse_options(argc, argv, builtin_clone_options,
+       argc = parse_options(argc, argv, prefix, builtin_clone_options,
                             builtin_clone_usage, 0);
 
        if (argc == 0)