From: Johannes Sixt Date: Fri, 23 Jan 2009 07:09:00 GMT Subject: Re: [PATCH 1/3] Add "partial commit" tests during a conflicted merge Message-ID: <49796D0C.5070408@viscovery.net> In-Reply-To: <7vbpty4kby.fsf_-_@gitster.siamese.dyndns.org> Junio C Hamano schrieb: > +test_expect_success 'setup merge commit with paths test' ' > + git reset --hard && > + git checkout HEAD^0 && > + echo frotz >file && > + test_tick && > + git add file && > + git commit -a -m "one side says frotz" && > + git tag one-side-says-frotz && > + git reset --hard HEAD^ && > + echo nitfol >file && > + test_tick && > + git add file && > + git commit -a -m "the other side says nitfol" && > + git tag the-other-side-says-nitfol > +' > + > +test_expect_success 'reject --only during a merge' ' > + git checkout HEAD^0 && > + git reset --hard the-other-side-says-nitfol && > + test_must_fail git merge one-side-says-frotz && > + echo yomin-only >file && > + test_must_fail git commit -m merge --only file && I don't see why this must fail: 'file' is the only file that is different from HEAD. Yes, currently we fail; but if something is about to be changed, then this can change as well. > + git reset --hard > +' > + > +test_expect_success 'allow --include during a merge' ' > + git checkout HEAD^0 && > + git reset --hard the-other-side-says-nitfol && > + test_must_fail git merge one-side-says-frotz && > + echo yomin-include >file && > + git commit -m merge --include file && > + git reset --hard > +' > + > +test_expect_failure 'assume --include during a merge' ' > + git checkout HEAD^0 && > + git reset --hard the-other-side-says-nitfol && > + test_must_fail git merge one-side-says-frotz && > + echo yomin-assumed >file && > + git add file && > + git commit -m merge file && > + git reset --hard > +' If I read the test case correctly, there is only 'file' that is different from HEAD, and it had a conflict. But IMO, the test should stress the point that after the conflicted merge there are at least two files that are different from HEAD, one was trivially merged, and the other had a conflict. -- Hannes