Re: [PATCH] builtin-merge: fail properly when we are in the middle of a conflicted merge

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Miklos Vajna <vmiklos@xxxxxxxxxxxxxx> writes:

> Using unmerged_cache() without reading the cache first never will return
> anything. However, if we read the cache early then we have to discard it
> when we want to read it again from the disk.

I do not think the fix is correct with or without this one.  You are
writing a wrong index and recording a wrong tree object in the commit.

I have a two-liner fix for the issue I am testing right now.

diff --git c/t/t7605-merge-resolve.sh w/t/t7605-merge-resolve.sh
index ee21a10..a251dac 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)
 '
 
 test_expect_success 'merge c2 to c3 (fails)' '
--
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

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux