Skip to content

Commit

Permalink
receive-pack: don't copy "dir" parameter
Browse files Browse the repository at this point in the history
We used to do this so could pass a mutable string to
enter_repo. But since 1c64b48 (enter_repo: do not modify
input, 2011-10-04), this is not necessary.

The resulting code is simpler, and it fixes a minor leak.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
  • Loading branch information
Jeff King authored and Junio C Hamano committed Jul 24, 2014
1 parent e156455 commit d51428b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions builtin/receive-pack.c
Original file line number Diff line number Diff line change
Expand Up @@ -1125,7 +1125,7 @@ int cmd_receive_pack(int argc, const char **argv, const char *prefix)
int advertise_refs = 0;
int stateless_rpc = 0;
int i;
char *dir = NULL;
const char *dir = NULL;
struct command *commands;
struct sha1_array shallow = SHA1_ARRAY_INIT;
struct sha1_array ref = SHA1_ARRAY_INIT;
Expand Down Expand Up @@ -1160,7 +1160,7 @@ int cmd_receive_pack(int argc, const char **argv, const char *prefix)
}
if (dir)
usage(receive_pack_usage);
dir = xstrdup(arg);
dir = arg;
}
if (!dir)
usage(receive_pack_usage);
Expand Down

0 comments on commit d51428b

Please sign in to comment.