summaryrefslogtreecommitdiff
path: root/builtin/fetch-pack.c
diff options
context:
space:
mode:
authorMichael Haggerty <mhagger@alum.mit.edu>2012-05-21 07:59:56 (GMT)
committerJunio C Hamano <gitster@pobox.com>2012-05-22 19:57:19 (GMT)
commit9d19c6ea52755edec9b8e6d5b838b712fc7e97f6 (patch)
treef66561781cb551c9e90ce9fe186aaf30781f44e3 /builtin/fetch-pack.c
parent078b895fefdca94995862a4cc8644198b00a89bf (diff)
downloadgit-9d19c6ea52755edec9b8e6d5b838b712fc7e97f6.zip
git-9d19c6ea52755edec9b8e6d5b838b712fc7e97f6.tar.gz
git-9d19c6ea52755edec9b8e6d5b838b712fc7e97f6.tar.bz2
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>
Diffstat (limited to 'builtin/fetch-pack.c')
-rw-r--r--builtin/fetch-pack.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/builtin/fetch-pack.c b/builtin/fetch-pack.c
index a9b6077..25c79ca 100644
--- a/builtin/fetch-pack.c
+++ b/builtin/fetch-pack.c
@@ -900,7 +900,8 @@ int cmd_fetch_pack(int argc, const char **argv, const char *prefix)
{
int i, ret, nr_heads;
struct ref *ref = NULL;
- char *dest = NULL, **heads;
+ const char *dest = NULL;
+ char **heads;
int fd[2];
char *pack_lockfile = NULL;
char **pack_lockfile_ptr = NULL;
@@ -970,7 +971,7 @@ int cmd_fetch_pack(int argc, const char **argv, const char *prefix)
}
usage(fetch_pack_usage);
}
- dest = (char *)arg;
+ dest = arg;
heads = (char **)(argv + i + 1);
nr_heads = argc - i - 1;
break;
@@ -1017,7 +1018,7 @@ int cmd_fetch_pack(int argc, const char **argv, const char *prefix)
fd[0] = 0;
fd[1] = 1;
} else {
- conn = git_connect(fd, (char *)dest, args.uploadpack,
+ conn = git_connect(fd, dest, args.uploadpack,
args.verbose ? CONNECT_VERBOSE : 0);
}