Web lists-archives.com

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




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@xxxxxxxxxxxx>

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.

> ---
>  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