Andrew's git
/
gitweb.git
/ diff
summary
|
log
|
commit
| diff |
tree
commit
grep
author
committer
pickaxe
?
re
cmd_fetch_pack(): declare dest to be const
author
Michael Haggerty
<mhagger@alum.mit.edu>
Mon, 21 May 2012 07:59:56 +0000
(09:59 +0200)
committer
Junio C Hamano
<gitster@pobox.com>
Tue, 22 May 2012 19:57:19 +0000
(12:57 -0700)
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>
builtin/fetch-pack.c
patch
|
blob
|
history
raw
|
patch
| inline |
side by side
(parent:
078b895
)
diff --git
a/builtin/fetch-pack.c
b/builtin/fetch-pack.c
index a9b6077af3ccfe8a66d3226af994ed77289bd544..25c79ca8c4399b675c2f22a96b3128254640056f 100644
(file)
--- 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);
}