Browse Source

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>
stable-4.3
Matthias Sohn 9 years ago
parent
commit
d3e61db455
  1. 3
      org.eclipse.jgit/src/org/eclipse/jgit/hooks/PrePushHook.java

3
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 };
}

Loading…
Cancel
Save