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

Re: [PATCH] Fix in-index merge.

From
Junio C Hamano <gitster@pobox.com>
Date
Aug 23, 2008, 10:00 UTC
Message-ID
<7v7ia8126z.fsf@gitster.siamese.dyndns.org>
In-Reply-To
<7vej4g12dv.fsf@gitster.siamese.dyndns.org>
Junio C Hamano <gitster@pobox.com> writes:
Show 20 quoted lines
> Here is a tentative fix on top of Miklos's two patches, even though I
> won't take them as-is until the test scripts are cleaned up.
>
>  t/t7605-merge-resolve.sh |    4 +++-
>  unpack-trees.c           |    2 ++
>  2 files changed, 5 insertions(+), 1 deletions(-)
>
> diff --git c/t/t7605-merge-resolve.sh w/t/t7605-merge-resolve.sh
> index ee21a10..be21ded 100755
> --- c/t/t7605-merge-resolve.sh
> +++ w/t/t7605-merge-resolve.sh
> @@ -36,7 +36,9 @@ test_expect_success 'merge c1 to c2' '
>  	git diff --exit-code &&
>  	test -f c0.c &&
>  	test -f c1.c &&
> -	test -f c2.c
> +	test -f c2.c &&
> +	test 3 = $(git ls-tree -r HEAD | wc -l) &&
> +	test 2 = $(git ls-files | wc -l)
>  '

Sorry, the last "2" should obviously be "3". We are making sure all three paths are included in the result.

Show 15 quoted lines
>  
>  test_expect_success 'merge c2 to c3 (fails)' '
> diff --git c/unpack-trees.c w/unpack-trees.c
> index cba0aca..016fd46 100644
> --- c/unpack-trees.c
> +++ w/unpack-trees.c
> @@ -378,6 +378,8 @@ int unpack_trees(unsigned len, struct tree_desc *t, struct unpack_trees_options
>  	memset(&o->result, 0, sizeof(o->result));
>  	if (o->src_index)
>  		o->result.timestamp = o->src_index->timestamp;
> +	if (o->dst_index)
> +		o->result.alloc = xmalloc(1);
>  	o->merge_size = len;
>  
>  	if (!dfc)
Previous: Junio C HamanoNext: Junio C Hamano
Message 18 of 22 in “[bug] git `next' does not do trivial merges”
  1. Paolo BonziniAug 22, 2008
  2. Jeff KingAug 22, 2008
  3. Miklos VajnaAug 23, 2008
  4. Fix in-index merge.Miklos Vajna, Aug 23, 2008
  5. builtin-merge: fail properly when we are in the middle of a conflicted mergeMiklos Vajna, Aug 23, 2008
  6. Junio C HamanoAug 23, 2008
  7. builtin-merge: fail properly when we are in the middle of a conflicted mergeMiklos Vajna, Aug 23, 2008
  8. Junio C HamanoAug 23, 2008
  9. 1/2 merge: fix numerus bugs around "trivial merge" areaJunio C Hamano, Aug 23, 2008
  10. Junio C HamanoAug 24, 2008
  11. builtin-merge: avoid run_command_v_opt() for recursive and subtreeMiklos Vajna, Aug 28, 2008
  12. 2/2 unpack_trees(): protect the handcrafted in-core index from read_cache()Junio C Hamano, Aug 23, 2008
  13. Junio C HamanoAug 23, 2008
  14. Junio C HamanoAug 23, 2008
  15. Fix in-index merge.Miklos Vajna, Aug 23, 2008
  16. Paolo BonziniAug 23, 2008
  17. Junio C HamanoAug 23, 2008
  18. Junio C HamanoAug 23, 2008
  19. [RFH] two and half potential fixlets to the in-core index handlingJunio C Hamano, Aug 23, 2008
  20. Linus TorvaldsAug 23, 2008
  21. Junio C HamanoAug 23, 2008
  22. Junio C HamanoAug 23, 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.