Browse Source

Adapt merge message to C Git for remote-tracking branch

Commit 13931236b9ee2895a98ffdbdacbd0f895956d8a8 in C Git (2011-11-02)
changed the message format:

-Merge remote branch 'origin/foo'
+Merge remote-tracking branch 'origin/foo'

This change does the same in EGit to be consistent.

Change-Id: I7d9c5afa95771dbfe6079b5f89a10b248fee0172
Signed-off-by: Robin Stocker <robin@nibor.org>
stable-1.2
Robin Stocker 13 years ago
parent
commit
8456cb3f2b
  1. 4
      org.eclipse.jgit.test/tst/org/eclipse/jgit/merge/MergeMessageFormatterTest.java
  2. 4
      org.eclipse.jgit/src/org/eclipse/jgit/merge/MergeMessageFormatter.java

4
org.eclipse.jgit.test/tst/org/eclipse/jgit/merge/MergeMessageFormatterTest.java

@ -114,7 +114,7 @@ public class MergeMessageFormatterTest extends SampleDataRepositoryTestCase {
Ref remoteA = db.getRef("refs/remotes/origin/remote-a"); Ref remoteA = db.getRef("refs/remotes/origin/remote-a");
Ref master = db.getRef("refs/heads/master"); Ref master = db.getRef("refs/heads/master");
String message = formatter.format(Arrays.asList(remoteA), master); String message = formatter.format(Arrays.asList(remoteA), master);
assertEquals("Merge remote branch 'origin/remote-a'", message); assertEquals("Merge remote-tracking branch 'origin/remote-a'", message);
} }
@Test @Test
@ -123,7 +123,7 @@ public class MergeMessageFormatterTest extends SampleDataRepositoryTestCase {
Ref remoteA = db.getRef("refs/remotes/origin/remote-a"); Ref remoteA = db.getRef("refs/remotes/origin/remote-a");
Ref master = db.getRef("refs/heads/master"); Ref master = db.getRef("refs/heads/master");
String message = formatter.format(Arrays.asList(c, remoteA), master); String message = formatter.format(Arrays.asList(c, remoteA), master);
assertEquals("Merge branch 'c', remote branch 'origin/remote-a'", assertEquals("Merge branch 'c', remote-tracking branch 'origin/remote-a'",
message); message);
} }

4
org.eclipse.jgit/src/org/eclipse/jgit/merge/MergeMessageFormatter.java

@ -99,8 +99,8 @@ public class MergeMessageFormatter {
listings.add(joinNames(branches, "branch", "branches")); listings.add(joinNames(branches, "branch", "branches"));
if (!remoteBranches.isEmpty()) if (!remoteBranches.isEmpty())
listings.add(joinNames(remoteBranches, "remote branch", listings.add(joinNames(remoteBranches, "remote-tracking branch",
"remote branches")); "remote-tracking branches"));
if (!tags.isEmpty()) if (!tags.isEmpty())
listings.add(joinNames(tags, "tag", "tags")); listings.add(joinNames(tags, "tag", "tags"));

Loading…
Cancel
Save