git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH v2 2/2] submodule--helper.c: remove duplicate code

From
BWBrandon Williams <bmwill@google.com>
Date
Mar 9, 2017, 00:38 UTC
Message-ID
<20170309003858.GB153031@google.com>
In-Reply-To
<20170309000352.18330-3-me@vtolstov.org>
On 03/09, Valery Tolstov wrote:
> Remove code fragment from module_clone that duplicates functionality
> of connect_work_tree_and_git_dir in dir.c
> 
> Signed-off-by: Valery Tolstov <me@vtolstov.org>

Patch looks good all the tests pass when running this on top of Stefan's checkout series 'origin/sb/checkout-recurse-submodules'. There is still one more bit of cleanup that you can do.

Show 15 quoted lines
> ---
>  builtin/submodule--helper.c | 20 ++------------------
>  1 file changed, 2 insertions(+), 18 deletions(-)
> 
> diff --git a/builtin/submodule--helper.c b/builtin/submodule--helper.c
> index 899dc334e..405cbea07 100644
> --- a/builtin/submodule--helper.c
> +++ b/builtin/submodule--helper.c
> @@ -579,7 +579,6 @@ static int module_clone(int argc, const char **argv, const char *prefix)
>  	const char *name = NULL, *url = NULL, *depth = NULL;
>  	int quiet = 0;
>  	int progress = 0;
> -	FILE *submodule_dot_git;
>  	char *p, *path = NULL, *sm_gitdir;
>  	struct strbuf rel_path = STRBUF_INIT;

rel_path is no longer used so it and the call to strbuf_release() to free its memory can be removed.

-- 
Brandon Williams
Previous: Valery TolstovNext: Valery Tolstov
Message 8 of 24 in “submodule--helper.c: remove duplicate code”
  1. submodule--helper.c: remove duplicate codeme@vtolstov.org, Mar 8, 2017
  2. Stefan BellerMar 8, 2017
  3. Valery TolstovMar 8, 2017
  4. Stefan BellerMar 8, 2017
  5. 0/2 Remove duplicate code from module_clone()Valery Tolstov, Mar 9, 2017
  6. 1/2 connect_work_tree_and_git_dir: safely create leading directoriesValery Tolstov, Mar 9, 2017
  7. 2/2 submodule--helper.c: remove duplicate codeValery Tolstov, Mar 9, 2017
  8. Brandon WilliamsMar 9, 2017
  9. 0/2 Remove duplicate code from module_clone()Valery Tolstov, Mar 9, 2017
  10. 2/2 submodule--helper.c: remove duplicate codeValery Tolstov, Mar 9, 2017
  11. Brandon WilliamsMar 9, 2017
  12. Junio C HamanoMar 10, 2017
  13. Stefan BellerMar 10, 2017
  14. Junio C HamanoMar 10, 2017
  15. Stefan BellerMar 10, 2017
  16. Valery TolstovMar 9, 2017
  17. 1/2 connect_work_tree_and_git_dir: safely create leading directoriesValery Tolstov, Mar 9, 2017
  18. Brandon WilliamsMar 9, 2017
  19. Valery TolstovMar 9, 2017
  20. Brandon WilliamsMar 9, 2017
  21. Valery TolstovMar 8, 2017
  22. Stefan BellerMar 8, 2017
  23. Junio C HamanoMar 8, 2017
  24. Stefan BellerMar 8, 2017

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.