diff --git a/builtin/submodule--helper.c b/builtin/submodule--helper.c index ef56471a8c..ebd00f57e5 100644 --- a/builtin/submodule--helper.c +++ b/builtin/submodule--helper.c @@ -2126,7 +2126,7 @@ static int is_tip_reachable(const char *path, const struct object_id *oid) char *hex = oid_to_hex(oid); cp.git_cmd = 1; - cp.dir = xstrdup(path); + cp.dir = path; cp.no_stderr = 1; strvec_pushl(&cp.args, "rev-list", "-n", "1", hex, "--not", "--all", NULL); @@ -2145,7 +2145,7 @@ static int fetch_in_submodule(const char *module_path, int depth, int quiet, prepare_submodule_repo_env(&cp.env); cp.git_cmd = 1; - cp.dir = xstrdup(module_path); + cp.dir = module_path; strvec_push(&cp.args, "fetch"); if (quiet) @@ -2198,7 +2198,7 @@ static int run_update_command(const struct update_data *ud, int subforce) } strvec_push(&cp.args, oid); - cp.dir = xstrdup(ud->sm_path); + cp.dir = ud->sm_path; prepare_submodule_repo_env(&cp.env); if ((ret = run_command(&cp))) { switch (ud->update_strategy.type) {