Re: [PATCH 7/6 (v4)] support for commit grafts, slight change to general mechanism

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

 



Thomas Rast wrote:
> Nick Edelen wrote:
> > Adds support for graft commits in rev-cache (w/ test), and slightly alters
> > graft mechanism.  Before, parse_commit() checked the graft list on every
> > commit.  Now register_commit_graft() preemptively loads graft commits into
> > memory, and sets a new 'graft' flag in the object.  This allows awareness of
> > the commits' medical history without searching a (normally private) array upon
> > each commit.
> 
> I felt adventurous and merged the topic into my local build, but I get
> "error: duplicate graft data ..." in repositories with only a single
> line in .git/info/grafts, which bisects to this commit (1c0a666 in
> today's pu).

Here's the complaint in squashable form if you want to keep it as a
testcase:

diff --git i/t/t6001-rev-list-graft.sh w/t/t6001-rev-list-graft.sh
index b2131cd..49ba37b 100755
--- i/t/t6001-rev-list-graft.sh
+++ w/t/t6001-rev-list-graft.sh
@@ -110,4 +110,18 @@ do
 	"
 
 done
+
+duplicate_error="error: duplicate graft"
+
+test_expect_success 'duplicates: no false positives' '
+	echo $B0 $A2 > .git/info/grafts &&
+	! git rev-list -1 HEAD 2>&1 | grep -q "$duplicate_error"
+'
+
+test_expect_success 'duplicates: no false negatives' '
+	echo $B0 $A2 > .git/info/grafts &&
+	echo $B0 $A1 >> .git/info/grafts &&
+	git rev-list -1 HEAD 2>&1 | grep "$duplicate_error"
+'
+
 test_done


-- 
Thomas Rast
trast@{inf,student}.ethz.ch
--
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]