|
|
|
@ -73,17 +73,18 @@ public class SquashMessageFormatterTest extends SampleDataRepositoryTestCase {
|
|
|
|
|
|
|
|
|
|
@Test |
|
|
|
|
public void testCommit() throws Exception { |
|
|
|
|
Git git = new Git(db); |
|
|
|
|
revCommit = git.commit().setMessage("squash_me").call(); |
|
|
|
|
try (Git git = new Git(db)) { |
|
|
|
|
revCommit = git.commit().setMessage("squash_me").call(); |
|
|
|
|
|
|
|
|
|
Ref master = db.exactRef("refs/heads/master"); |
|
|
|
|
String message = msgFormatter.format(Arrays.asList(revCommit), master); |
|
|
|
|
assertEquals( |
|
|
|
|
"Squashed commit of the following:\n\ncommit " |
|
|
|
|
+ revCommit.getName() + "\nAuthor: " |
|
|
|
|
+ revCommit.getAuthorIdent().getName() + " <" |
|
|
|
|
+ revCommit.getAuthorIdent().getEmailAddress() |
|
|
|
|
+ ">\nDate: " + dateFormatter.formatDate(author) |
|
|
|
|
+ "\n\n\tsquash_me\n", message); |
|
|
|
|
Ref master = db.exactRef("refs/heads/master"); |
|
|
|
|
String message = msgFormatter.format(Arrays.asList(revCommit), master); |
|
|
|
|
assertEquals( |
|
|
|
|
"Squashed commit of the following:\n\ncommit " |
|
|
|
|
+ revCommit.getName() + "\nAuthor: " |
|
|
|
|
+ revCommit.getAuthorIdent().getName() + " <" |
|
|
|
|
+ revCommit.getAuthorIdent().getEmailAddress() |
|
|
|
|
+ ">\nDate: " + dateFormatter.formatDate(author) |
|
|
|
|
+ "\n\n\tsquash_me\n", message); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|