]> git.ipfire.org Git - thirdparty/git.git/commitdiff
upload-archive: do not copy repo name
authorJeff King <peff@peff.net>
Wed, 20 Feb 2013 20:00:59 +0000 (15:00 -0500)
committerJunio C Hamano <gitster@pobox.com>
Wed, 20 Feb 2013 21:42:21 +0000 (13:42 -0800)
According to the comment, enter_repo will modify its input.
However, this has not been the case since 1c64b48
(enter_repo: do not modify input, 2011-10-04). Drop the
now-useless copy.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin/upload-archive.c

index b928beb8ed51c9af9aa4f640e80443a5e059d505..c3d134eac10227e507fa8fcf1563c3430baebe1d 100644 (file)
@@ -27,13 +27,8 @@ int cmd_upload_archive_writer(int argc, const char **argv, const char *prefix)
        if (argc != 2)
                usage(upload_archive_usage);
 
-       if (strlen(argv[1]) + 1 > sizeof(buf))
-               die("insanely long repository name");
-
-       strcpy(buf, argv[1]); /* enter-repo smudges its argument */
-
-       if (!enter_repo(buf, 0))
-               die("'%s' does not appear to be a git repository", buf);
+       if (!enter_repo(argv[1], 0))
+               die("'%s' does not appear to be a git repository", argv[1]);
 
        /* put received options in sent_argv[] */
        sent_argc = 1;