diff options
author | Jeff King <peff@peff.net> | 2014-07-24 08:40:43 +0400 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2014-07-25 00:57:49 +0400 |
commit | d51428bf17e9f17071836350299e256cac2d503a (patch) | |
tree | 0ad14960c445738afa912721463bf5f9a42220ea | |
parent | e156455ea49124c140a67623f22a393db62d5d98 (diff) |
receive-pack: don't copy "dir" parameter
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>
-rw-r--r-- | builtin/receive-pack.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/builtin/receive-pack.c b/builtin/receive-pack.c index c3230817db..be8c2db26c 100644 --- a/builtin/receive-pack.c +++ b/builtin/receive-pack.c @@ -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; @@ -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); |