summaryrefslogtreecommitdiffstats
path: root/org.eclipse.jgit
diff options
context:
space:
mode:
authorMatthias Sohn <matthias.sohn@sap.com>2015-11-17 17:26:53 +0100
committerMatthias Sohn <matthias.sohn@sap.com>2015-11-18 09:50:51 +0100
commitd3e61db455174ce8af70fcc80a19f414881dfea9 (patch)
tree9a3c8062f8de64748f2cc62f6f105e2698e11547 /org.eclipse.jgit
parent69cd6f586418291c980831cd92508c549c84ce94 (diff)
downloadjgit-d3e61db455174ce8af70fcc80a19f414881dfea9.tar.gz
jgit-d3e61db455174ce8af70fcc80a19f414881dfea9.zip
Fix pre-push hook to not set null remoteName as first argument
According to [1] the pre-push hook expects two parameters which provide the name and location of the destination remote, if a named remote is not being used both values should be the same. We did set the first parameter to null in that case which caused ProcessBuilder to throw a NullPointerException since its start() method doesn't accept null arguments. [1] https://git-scm.com/docs/githooks#_pre_push Bug: 482393 Change-Id: Idb9b0a48cefac01abfcfdf00f6d173f8fa1d9a7b Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
Diffstat (limited to 'org.eclipse.jgit')
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/hooks/PrePushHook.java3
1 files changed, 3 insertions, 0 deletions
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/hooks/PrePushHook.java b/org.eclipse.jgit/src/org/eclipse/jgit/hooks/PrePushHook.java
index 2e6582819f..a501fee901 100644
--- a/org.eclipse.jgit/src/org/eclipse/jgit/hooks/PrePushHook.java
+++ b/org.eclipse.jgit/src/org/eclipse/jgit/hooks/PrePushHook.java
@@ -113,6 +113,9 @@ public class PrePushHook extends GitHook<String> {
*/
@Override
protected String[] getParameters() {
+ if (remoteName == null) {
+ remoteName = remoteLocation;
+ }
return new String[] { remoteName, remoteLocation };
}