Skip to content

Commit 6379dd0

Browse files
peffgitster
authored andcommitted
upload-archive: do not copy repo name
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>
1 parent 8f9e3e4 commit 6379dd0

File tree

1 file changed

+2
-7
lines changed

1 file changed

+2
-7
lines changed

builtin/upload-archive.c

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -27,13 +27,8 @@ int cmd_upload_archive_writer(int argc, const char **argv, const char *prefix)
2727
if (argc != 2)
2828
usage(upload_archive_usage);
2929

30-
if (strlen(argv[1]) + 1 > sizeof(buf))
31-
die("insanely long repository name");
32-
33-
strcpy(buf, argv[1]); /* enter-repo smudges its argument */
34-
35-
if (!enter_repo(buf, 0))
36-
die("'%s' does not appear to be a git repository", buf);
30+
if (!enter_repo(argv[1], 0))
31+
die("'%s' does not appear to be a git repository", argv[1]);
3732

3833
/* put received options in sent_argv[] */
3934
sent_argc = 1;

0 commit comments

Comments
 (0)