diff options
author | Matthias Sohn <matthias.sohn@sap.com> | 2013-12-05 00:14:08 +0100 |
---|---|---|
committer | Matthias Sohn <matthias.sohn@sap.com> | 2013-12-05 00:14:25 +0100 |
commit | 162a5c4c89b289af3755a2f26843cdf908e93c50 (patch) | |
tree | 377792666836715cee1ec2f4d5582641d854dce3 /org.eclipse.jgit.test/tst/org/eclipse/jgit/api/MergeCommandTest.java | |
parent | fceae20181b2b20632fe44731407bfb940093817 (diff) | |
parent | f86a488e32906593903acb31a93a82bed8d87915 (diff) | |
download | jgit-162a5c4c89b289af3755a2f26843cdf908e93c50.tar.gz jgit-162a5c4c89b289af3755a2f26843cdf908e93c50.zip |
Merge branch 'master' into stable-3.2
* master:
Implement rebase.autostash
CLI status should support --porcelain
More helpful InvalidPathException messages (include reason)
Fix IgnoreRule#isMatch returning wrong result due to missing reset
Fix exception on conflicts with recursive merge
Add pgm test for checkout of existing branch with checkout conflict
Fix broken symbolic links on Cygwin.
Do not allow non-ff-rebase if there are uncommitted changes
Manage CheckoutConflictException in pgm
Fix handling of file/folder conflicts during a checkout
Mention null return in Javadoc of Config#getString
Fix applying stash on other commit
Use static factory methods instead of overloaded constructors
Break up GCTest to run in parallel
Modify T0004_PackReaderTest to use existing pack
Move SampleDataRepositoryTestCase to org.eclipse.jgit.test
Support running from JARs in JGitTestUtil
Cache SimpleDateFormat in GitDateParser per locale
Fix FIXUP error for blank lines in interactive rebase
Fix parsing Rebase todo lines when commit message is missing
Add close() method to API
Update Jetty to 7.6.14.v20131031
Document that path parameters should use '/' as separator
Improve Javadoc for typeHint parameter
Do not update the ref hot bit when checking isIndexLoaded
Don't delete .idx file if .pack file can't be deleted
Change-Id: I02abfc09000d0fe9bdf4331c65bec7046f586179
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
Diffstat (limited to 'org.eclipse.jgit.test/tst/org/eclipse/jgit/api/MergeCommandTest.java')
-rw-r--r-- | org.eclipse.jgit.test/tst/org/eclipse/jgit/api/MergeCommandTest.java | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/api/MergeCommandTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/api/MergeCommandTest.java index 29146dc585..1eeb9f7c0d 100644 --- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/api/MergeCommandTest.java +++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/api/MergeCommandTest.java @@ -56,8 +56,11 @@ import org.eclipse.jgit.api.MergeCommand.FastForwardMode; import org.eclipse.jgit.api.MergeResult.MergeStatus; import org.eclipse.jgit.api.errors.InvalidMergeHeadsException; import org.eclipse.jgit.junit.RepositoryTestCase; +import org.eclipse.jgit.junit.TestRepository; +import org.eclipse.jgit.junit.TestRepository.BranchBuilder; import org.eclipse.jgit.lib.Constants; import org.eclipse.jgit.lib.Ref; +import org.eclipse.jgit.lib.Repository; import org.eclipse.jgit.lib.RepositoryState; import org.eclipse.jgit.merge.MergeStrategy; import org.eclipse.jgit.merge.ResolveMerger.MergeFailureReason; @@ -1532,6 +1535,37 @@ public class MergeCommandTest extends RepositoryTestCase { assertEquals(MergeStatus.ABORTED, result.getMergeStatus()); } + + @Test + public void testRecursiveMergeWithConflict() throws Exception { + TestRepository<Repository> db_t = new TestRepository<Repository>(db); + BranchBuilder master = db_t.branch("master"); + RevCommit m0 = master.commit().add("f", "1\n2\n3\n4\n5\n6\n7\n8\n9\n") + .message("m0").create(); + RevCommit m1 = master.commit() + .add("f", "1-master\n2\n3\n4\n5\n6\n7\n8\n9\n").message("m1") + .create(); + db_t.getRevWalk().parseCommit(m1); + + BranchBuilder side = db_t.branch("side"); + RevCommit s1 = side.commit().parent(m0) + .add("f", "1\n2\n3\n4\n5\n6\n7\n8\n9-side\n").message("s1") + .create(); + RevCommit s2 = side.commit().parent(m1) + .add("f", "1-master\n2\n3\n4\n5\n6\n7-res(side)\n8\n9-side\n") + .message("s2(merge)").create(); + master.commit().parent(s1) + .add("f", "1-master\n2\n3\n4\n5\n6\n7-conflict\n8\n9-side\n") + .message("m2(merge)").create(); + + Git git = Git.wrap(db); + git.checkout().setName("master").call(); + + MergeResult result = git.merge().setStrategy(MergeStrategy.RECURSIVE) + .include("side", s2).call(); + assertEquals(MergeStatus.CONFLICTING, result.getMergeStatus()); + } + private static void setExecutable(Git git, String path, boolean executable) { FS.DETECTED.setExecute( new File(git.getRepository().getWorkTree(), path), executable); |