diff options
author | Matthias Sohn | 2014-04-30 21:37:49 +0000 |
---|---|---|
committer | Robin Stocker | 2014-05-01 14:39:42 +0000 |
commit | d8ac93c8e28756b780670de15596e96037f61a4c (patch) | |
tree | 90c8cf3ce510c010b913fd1121c6a2777771db27 | |
parent | 68f0c309a4b8a9f3e00bdefb623234980deda12a (diff) | |
download | egit-d8ac93c8e28756b780670de15596e96037f61a4c.tar.gz egit-d8ac93c8e28756b780670de15596e96037f61a4c.tar.xz egit-d8ac93c8e28756b780670de15596e96037f61a4c.zip |
Also show Gerrit actions if notes refspec is existing
So far Gerrit actions are enabled for a repository if the option
gerrit.createchangeid = true or a push refspec exists which has a
destination starting with 'refs/for/'.
Enhance this to also enable Gerrit actions if a fetch refspec exists
with both source and destination are starting with 'refs/notes/'.
Bug: 433439
Change-Id: Ifdc0aa044c1694bcdb808e205592fd2b40dba624
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
-rw-r--r-- | org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/ResourcePropertyTester.java | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/ResourcePropertyTester.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/ResourcePropertyTester.java index 5a67e9b454..b4c6d70215 100644 --- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/ResourcePropertyTester.java +++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/ResourcePropertyTester.java @@ -21,6 +21,7 @@ import org.eclipse.egit.core.project.RepositoryMapping; import org.eclipse.egit.ui.internal.gerrit.GerritUtil; import org.eclipse.egit.ui.internal.trace.GitTraceLocation; import org.eclipse.jgit.lib.Config; +import org.eclipse.jgit.lib.Constants; import org.eclipse.jgit.lib.Repository; import org.eclipse.jgit.lib.RepositoryState; import org.eclipse.jgit.transport.RefSpec; @@ -162,7 +163,17 @@ public class ResourcePropertyTester extends PropertyTester { String destination = pushSpec.getDestination(); if (destination == null) continue; - return destination.startsWith(GerritUtil.REFS_FOR); + if (destination.startsWith(GerritUtil.REFS_FOR)) + return true; + } + for (RefSpec fetchSpec : remoteConfig.getFetchRefSpecs()) { + String source = fetchSpec.getSource(); + String destination = fetchSpec.getDestination(); + if (source == null || destination == null) + continue; + if (source.startsWith(Constants.R_NOTES) + && destination.startsWith(Constants.R_NOTES)) + return true; } } } catch (URISyntaxException e) { |