summaryrefslogtreecommitdiff
path: root/receive-pack.c
diff options
context:
space:
mode:
authorJunio C Hamano <junkio@cox.net>2006-03-05 02:47:29 -0800
committerJunio C Hamano <junkio@cox.net>2006-03-05 02:47:29 -0800
commit9201c707426b3dc0c894775416f576c25c008d46 (patch)
tree235727178999b09a9d26ff4c384199558761fe15 /receive-pack.c
parent4a5d6939509f9aeef600ea17643caef4c898b12f (diff)
downloadgit-9201c707426b3dc0c894775416f576c25c008d46.tar.gz
Const tightening.
Mark Wooding noticed there was a type mismatch warning in git.c; this patch does things slightly differently (mostly tightening const) and was what I was holding onto, waiting for the setup-revisions change to be merged into the master branch. Signed-off-by: Junio C Hamano <junkio@cox.net>
Diffstat (limited to 'receive-pack.c')
-rw-r--r--receive-pack.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/receive-pack.c b/receive-pack.c
index 2a3db16d68..93929b5371 100644
--- a/receive-pack.c
+++ b/receive-pack.c
@@ -6,7 +6,7 @@
static const char receive_pack_usage[] = "git-receive-pack <git-dir>";
-static char *unpacker[] = { "unpack-objects", NULL };
+static const char *unpacker[] = { "unpack-objects", NULL };
static int report_status = 0;
@@ -177,7 +177,7 @@ static void run_update_post_hook(struct command *cmd)
{
struct command *cmd_p;
int argc;
- char **argv;
+ const char **argv;
if (access(update_post_hook, X_OK) < 0)
return;
@@ -190,10 +190,12 @@ static void run_update_post_hook(struct command *cmd)
argv[0] = update_post_hook;
for (argc = 1, cmd_p = cmd; cmd_p; cmd_p = cmd_p->next) {
+ char *p;
if (cmd_p->error_string)
continue;
- argv[argc] = xmalloc(strlen(cmd_p->ref_name) + 1);
- strcpy(argv[argc], cmd_p->ref_name);
+ p = xmalloc(strlen(cmd_p->ref_name) + 1);
+ strcpy(p, cmd_p->ref_name);
+ argv[argc] = p;
argc++;
}
argv[argc] = NULL;