Junio C Hamano <gitster@xxxxxxxxx> writes: > Junio C Hamano <gitster@xxxxxxxxx> writes: > >> Jeff King <peff@xxxxxxxx> writes: >> >>> There are no callers of the slightly-dangerous static-buffer >>> git_path_submodule left. Let's drop it. >> >> There are a few callers added on 'pu', though. > > Actually there is only one. Here is a proposed evil merge. Sorry, that didn't work X-<. diff --git a/submodule.c b/submodule.c index dfe8b7b..0cdaeb8 100644 --- a/submodule.c +++ b/submodule.c @@ -120,10 +120,10 @@ void stage_updated_gitmodules(void) static int add_submodule_odb(const char *path) { struct alternate_object_database *alt_odb; - const char *objects_directory; + char *objects_directory; int ret = 0; - objects_directory = git_path_submodule(path, "objects/"); + objects_directory = git_pathdup_submodule(path, "objects/"); if (!is_directory(objects_directory)) { ret = -1; goto done; @@ -148,6 +148,7 @@ static int add_submodule_odb(const char *path) read_info_alternates(objects_directory, 0); prepare_alt_odb(); done: + free(objects_directory); return ret; } -- To unsubscribe from this list: send the line "unsubscribe git" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html