Skip to content
This repository was archived by the owner on Nov 9, 2017. It is now read-only.

Commit d51428b

Browse files
peffgitster
authored andcommitted
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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent e156455 commit d51428b

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

builtin/receive-pack.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1125,7 +1125,7 @@ int cmd_receive_pack(int argc, const char **argv, const char *prefix)
11251125
int advertise_refs = 0;
11261126
int stateless_rpc = 0;
11271127
int i;
1128-
char *dir = NULL;
1128+
const char *dir = NULL;
11291129
struct command *commands;
11301130
struct sha1_array shallow = SHA1_ARRAY_INIT;
11311131
struct sha1_array ref = SHA1_ARRAY_INIT;
@@ -1160,7 +1160,7 @@ int cmd_receive_pack(int argc, const char **argv, const char *prefix)
11601160
}
11611161
if (dir)
11621162
usage(receive_pack_usage);
1163-
dir = xstrdup(arg);
1163+
dir = arg;
11641164
}
11651165
if (!dir)
11661166
usage(receive_pack_usage);

0 commit comments

Comments
 (0)