|
|
|
@ -140,12 +140,13 @@ public class PullCommandTest extends RepositoryTestCase {
|
|
|
|
|
ObjectId[] mergedCommits = mergeResult.getMergedCommits(); |
|
|
|
|
assertEquals(targetCommit.getId(), mergedCommits[0]); |
|
|
|
|
assertEquals(sourceCommit.getId(), mergedCommits[1]); |
|
|
|
|
RevCommit mergeCommit = new RevWalk(dbTarget).parseCommit(mergeResult |
|
|
|
|
.getNewHead()); |
|
|
|
|
try (RevWalk rw = new RevWalk(dbTarget)) { |
|
|
|
|
RevCommit mergeCommit = rw.parseCommit(mergeResult.getNewHead()); |
|
|
|
|
String message = "Merge branch 'master' of " |
|
|
|
|
+ db.getWorkTree().getAbsolutePath(); |
|
|
|
|
assertEquals(message, mergeCommit.getShortMessage()); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@Test |
|
|
|
|
public void testPullConflict() throws Exception { |
|
|
|
@ -259,12 +260,13 @@ public class PullCommandTest extends RepositoryTestCase {
|
|
|
|
|
ObjectId[] mergedCommits = mergeResult.getMergedCommits(); |
|
|
|
|
assertEquals(targetCommit.getId(), mergedCommits[0]); |
|
|
|
|
assertEquals(sourceCommit.getId(), mergedCommits[1]); |
|
|
|
|
RevCommit mergeCommit = new RevWalk(dbTarget).parseCommit(mergeResult |
|
|
|
|
.getNewHead()); |
|
|
|
|
try (RevWalk rw = new RevWalk(dbTarget)) { |
|
|
|
|
RevCommit mergeCommit = rw.parseCommit(mergeResult.getNewHead()); |
|
|
|
|
String message = "Merge branch 'other' of " |
|
|
|
|
+ db.getWorkTree().getAbsolutePath(); |
|
|
|
|
assertEquals(message, mergeCommit.getShortMessage()); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@Test |
|
|
|
|
public void testPullMergeProgrammaticConfigurationImpliedTargetBranch() |
|
|
|
@ -293,12 +295,13 @@ public class PullCommandTest extends RepositoryTestCase {
|
|
|
|
|
ObjectId[] mergedCommits = mergeResult.getMergedCommits(); |
|
|
|
|
assertEquals(targetCommit.getId(), mergedCommits[0]); |
|
|
|
|
assertEquals(sourceCommit.getId(), mergedCommits[1]); |
|
|
|
|
RevCommit mergeCommit = new RevWalk(dbTarget).parseCommit(mergeResult |
|
|
|
|
.getNewHead()); |
|
|
|
|
try (RevWalk rw = new RevWalk(dbTarget)) { |
|
|
|
|
RevCommit mergeCommit = rw.parseCommit(mergeResult.getNewHead()); |
|
|
|
|
String message = "Merge branch 'other' of " |
|
|
|
|
+ db.getWorkTree().getAbsolutePath() + " into other"; |
|
|
|
|
assertEquals(message, mergeCommit.getShortMessage()); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private enum TestPullMode { |
|
|
|
|
MERGE, REBASE, REBASE_PREASERVE |
|
|
|
|