Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRobin Stocker2011-02-01 21:27:33 +0000
committerRobin Stocker2011-02-01 21:27:33 +0000
commitb0245b548b9c9fe1801fb8af727b08a7c3cc9706 (patch)
tree04ce836acaff18892aed1e9b625d05f04622ba36 /org.eclipse.jgit
parent13bcf05a9ea2d4943faef2c879aac65d37517eb6 (diff)
downloadjgit-b0245b548b9c9fe1801fb8af727b08a7c3cc9706.tar.gz
jgit-b0245b548b9c9fe1801fb8af727b08a7c3cc9706.tar.xz
jgit-b0245b548b9c9fe1801fb8af727b08a7c3cc9706.zip
Don't print "into HEAD" when merging refs/heads/master
When MergeMessageFormatter was given a symbolic ref HEAD which points to refs/heads/master (which is the case when merging a branch in EGit), it would result in a merge message like the following: Merge branch 'a' into HEAD But it should print the following (as C Git does): Merge branch 'a' The solution is to use the leaf ref when checking for refs/heads/master. Change-Id: I28ae5713b7e8123a0176fc6d7356e469900e7e97
Diffstat (limited to 'org.eclipse.jgit')
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/merge/MergeMessageFormatter.java3
1 files changed, 2 insertions, 1 deletions
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/merge/MergeMessageFormatter.java b/org.eclipse.jgit/src/org/eclipse/jgit/merge/MergeMessageFormatter.java
index cb2f8a522c..cdd7a2f371 100644
--- a/org.eclipse.jgit/src/org/eclipse/jgit/merge/MergeMessageFormatter.java
+++ b/org.eclipse.jgit/src/org/eclipse/jgit/merge/MergeMessageFormatter.java
@@ -113,7 +113,8 @@ public class MergeMessageFormatter {
sb.append(StringUtils.join(listings, ", "));
- if (!target.getName().equals(Constants.R_HEADS + Constants.MASTER)) {
+ String targetName = target.getLeaf().getName();
+ if (!targetName.equals(Constants.R_HEADS + Constants.MASTER)) {
String targetShortName = Repository
.shortenRefName(target.getName());
sb.append(" into " + targetShortName);

Back to the top