Skip to content

Commit

Permalink
cmd_fetch_pack(): declare dest to be const
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Michael Haggerty authored and Junio C Hamano committed May 22, 2012
1 parent 078b895 commit 9d19c6e
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions builtin/fetch-pack.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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);
}

Expand Down

0 comments on commit 9d19c6e

Please sign in to comment.