Merging into a non-master branch would result in the following message:
Merge branch 'a' into HEAD
Now the merge message is correct:
Merge branch 'a' into b
Change-Id: I488f97190e4c1711c23a7a3cbd64f8b13a87bbac
Signed-off-by: Robin Stocker <robin@nibor.org>
assertEquals("Merge branch 'a' into b", message);
}
+ @Test
+ public void testIntoHeadOtherThanMaster() throws IOException {
+ Ref a = db.getRef("refs/heads/a");
+ Ref b = db.getRef("refs/heads/b");
+ SymbolicRef head = new SymbolicRef("HEAD", b);
+ String message = formatter.format(Arrays.asList(a), head);
+ assertEquals("Merge branch 'a' into b", message);
+ }
+
@Test
public void testIntoSymbolicRefHeadPointingToMaster() throws IOException {
Ref a = db.getRef("refs/heads/a");
String targetName = target.getLeaf().getName();
if (!targetName.equals(Constants.R_HEADS + Constants.MASTER)) {
- String targetShortName = Repository
- .shortenRefName(target.getName());
+ String targetShortName = Repository.shortenRefName(targetName);
sb.append(" into " + targetShortName);
}