Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthias Sohn2014-01-19 22:51:54 +0000
committerGerrit Code Review @ Eclipse.org2014-01-20 10:35:53 +0000
commit25ce3e586eb04ecc9177d4b75c465f0874809e72 (patch)
treeba8220963855dc3edfafbdfb78e42b75e5d25d28
parent95b9fbf65fb08bf86b2bebf1a52f59bbfd6627aa (diff)
downloadegit-25ce3e586eb04ecc9177d4b75c465f0874809e72.tar.gz
egit-25ce3e586eb04ecc9177d4b75c465f0874809e72.tar.xz
egit-25ce3e586eb04ecc9177d4b75c465f0874809e72.zip
Avoid NPE when push refspec doesn't specify destination ref
If a push refspec omits :<dst>, the same ref as <src> will be updated. See https://www.kernel.org/pub/software/scm/git/docs/git-push.html Bug: 426067 Change-Id: Ia8bee28f0930373493835c74418dfb27ee98e36b Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/ResourcePropertyTester.java8
1 files changed, 4 insertions, 4 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 2c520c6584..5a67e9b454 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
@@ -159,10 +159,10 @@ public class ResourcePropertyTester extends PropertyTester {
List<RemoteConfig> remoteConfigs = RemoteConfig.getAllRemoteConfigs(config);
for (RemoteConfig remoteConfig : remoteConfigs) {
for (RefSpec pushSpec : remoteConfig.getPushRefSpecs()) {
- boolean gerritPushRef = pushSpec.getDestination().startsWith(
- GerritUtil.REFS_FOR);
- if (gerritPushRef)
- return true;
+ String destination = pushSpec.getDestination();
+ if (destination == null)
+ continue;
+ return destination.startsWith(GerritUtil.REFS_FOR);
}
}
} catch (URISyntaxException e) {

Back to the top