Merge branch 'jk/skip-http-tests-under-no-curl'
[gitweb.git] / builtin / clone.c
index 2d77a2de4f3d3c73019b0b9873048f2d5747a378..166a645e2dcedc66b1d2f20ca01010a5ae2ee9d8 100644 (file)
@@ -34,7 +34,7 @@
  *
  */
 static const char * const builtin_clone_usage[] = {
-       N_("git clone [options] [--] <repo> [<dir>]"),
+       N_("git clone [<options>] [--] <repo> [<dir>]"),
        NULL
 };
 
@@ -293,16 +293,17 @@ static void copy_alternates(struct strbuf *src, struct strbuf *dst,
        struct strbuf line = STRBUF_INIT;
 
        while (strbuf_getline(&line, in, '\n') != EOF) {
-               char *abs_path, abs_buf[PATH_MAX];
+               char *abs_path;
                if (!line.len || line.buf[0] == '#')
                        continue;
                if (is_absolute_path(line.buf)) {
                        add_to_alternates_file(line.buf);
                        continue;
                }
-               abs_path = mkpath("%s/objects/%s", src_repo, line.buf);
-               normalize_path_copy(abs_buf, abs_path);
-               add_to_alternates_file(abs_buf);
+               abs_path = mkpathdup("%s/objects/%s", src_repo, line.buf);
+               normalize_path_copy(abs_path, abs_path);
+               add_to_alternates_file(abs_path);
+               free(abs_path);
        }
        strbuf_release(&line);
        fclose(in);