cmd_fetch_pack(): declare dest to be const

There is no need for it to be non-const, and this avoids the need for casting away the constness of an argv element. Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Michael Haggerty committed May 21, 2012 at 09:59 UTC 9d19c6ea52755edec9b8e6d5b838b712fc7e97f6
1 file changed +4 -3
builtin/fetch-pack.c
+4 -3
@@ -900,7 +900,8 @@ int cmd_fetch_pack(int argc, const char **argv, const char *prefix)
900 {
901 int i, ret, nr_heads;
902 struct ref *ref = NULL;
903 - char *dest = NULL, **heads;
903 + const char *dest = NULL;
904 + char **heads;
905 int fd[2];
906 char *pack_lockfile = NULL;
907 char **pack_lockfile_ptr = NULL;
@@ -970,7 +971,7 @@ int cmd_fetch_pack(int argc, const char **argv, const char *prefix)
971 }
972 usage(fetch_pack_usage);
973 }
973 - dest = (char *)arg;
974 + dest = arg;
975 heads = (char **)(argv + i + 1);
976 nr_heads = argc - i - 1;
977 break;
@@ -1017,7 +1018,7 @@ int cmd_fetch_pack(int argc, const char **argv, const char *prefix)
1018 fd[0] = 0;
1019 fd[1] = 1;
1020 } else {
1020 - conn = git_connect(fd, (char *)dest, args.uploadpack,
1021 + conn = git_connect(fd, dest, args.uploadpack,
1022 args.verbose ? CONNECT_VERBOSE : 0);
1023 }
1024