Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthias Sohn2016-09-13 23:16:37 +0000
committerMatthias Sohn2016-09-13 23:23:04 +0000
commit5652cb7ba8ce14c25a21657c345336f383edc064 (patch)
treecef54d267b0ae62833bce468968f17929862e81d
parent80197381ddb64714120c628fa93157476cc4c79e (diff)
downloadegit-5652cb7ba8ce14c25a21657c345336f383edc064.tar.gz
egit-5652cb7ba8ce14c25a21657c345336f383edc064.tar.xz
egit-5652cb7ba8ce14c25a21657c345336f383edc064.zip
Fix staging view to respect project-specific commit message template
When no resources where selected when staging view asked CommitMessageComponent to calculate a commit message Mylyn didn't have any project to load a project specific commit message template from. Bug: 348744 Change-Id: I1ce531aaaceb7f6ce6d5f0f1358919a97e64be76 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/dialogs/CommitMessageComponent.java6
1 files changed, 6 insertions, 0 deletions
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/dialogs/CommitMessageComponent.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/dialogs/CommitMessageComponent.java
index bdf536c14..cba4ec81c 100644
--- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/dialogs/CommitMessageComponent.java
+++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/dialogs/CommitMessageComponent.java
@@ -22,6 +22,7 @@ import java.io.File;
import java.io.IOException;
import java.net.URI;
import java.util.ArrayList;
+import java.util.Arrays;
import java.util.Collection;
import java.util.HashSet;
import java.util.Set;
@@ -35,6 +36,7 @@ import org.eclipse.core.runtime.IExtensionRegistry;
import org.eclipse.core.runtime.Platform;
import org.eclipse.egit.core.RevUtils;
import org.eclipse.egit.core.internal.gerrit.GerritUtil;
+import org.eclipse.egit.core.internal.util.ProjectUtil;
import org.eclipse.egit.ui.Activator;
import org.eclipse.egit.ui.ICommitMessageProvider;
import org.eclipse.egit.ui.UIPreferences;
@@ -678,6 +680,10 @@ public class CommitMessageComponent {
if (file != null)
resources.add(file.getProject());
}
+ if (resources.size() == 0 && repository != null) {
+ resources
+ .addAll(Arrays.asList(ProjectUtil.getProjects(repository)));
+ }
try {
ICommitMessageProvider messageProvider = getCommitMessageProvider();
if (messageProvider != null) {

Back to the top