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

Re: [PATCH] builtin-clone: fix for new unpack_trees() semantics

From
Daniel Barkalow <barkalow@iabervon.org>
Date
Mar 9, 2008, 22:35 UTC
Message-ID
<alpine.LNX.1.00.0803091829100.19665@iabervon.org>
In-Reply-To
<alpine.LSU.1.00.0803092227230.3975@racer.site>
On Sun, 9 Mar 2008, Johannes Schindelin wrote:
Show 21 quoted lines
> In git.git's "next" branch, unpack_trees() must specify source and target 
> index.
> 
> Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
> ---
> 
> 	To be squashed into 10/11
> 
>  builtin-clone.c |    2 ++
>  1 files changed, 2 insertions(+), 0 deletions(-)
> 
> diff --git a/builtin-clone.c b/builtin-clone.c
> index e4047ed..3890e12 100644
> --- a/builtin-clone.c
> +++ b/builtin-clone.c
> @@ -534,6 +534,8 @@ int cmd_clone(int argc, const char **argv, const char *prefix)
>  		opts.verbose_update = !option_quiet;
>  		opts.merge = 1;
>  		opts.fn = twoway_merge;
> +		opts.src_index = &the_index;
> +		opts.dst_index = &the_index;

Actually, I think the sensible thing is to just not do a merge here, since we know there's no index beforehand and the two trees are the same.

I think the odd twoway merge of two copies of HEAD is just an artifact of clone originally just doing "git checkout HEAD", and that got translated various times failing to notice the special cases.

	-Daniel
*This .sig left intentionally blank*
Previous: Johannes SchindelinNext: Johannes Schindelin
Message 3 of 8 in “Build in clone”
  1. 10/11 Build in cloneDaniel Barkalow, Mar 8, 2008
  2. builtin-clone: fix for new unpack_trees() semanticsJohannes Schindelin, Mar 9, 2008
  3. Daniel BarkalowMar 9, 2008
  4. Johannes SchindelinMar 9, 2008
  5. Daniel BarkalowMar 9, 2008
  6. Johannes SchindelinMar 9, 2008
  7. Daniel BarkalowMar 9, 2008
  8. Johannes SchindelinMar 10, 2008

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.