Parcourir la 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>
tags/v4.2.0.201601211800-r
Matthias Sohn il y a 8 ans
Parent
révision
d3e61db455
1 fichiers modifiés avec 3 ajouts et 0 suppressions
  1. 3
    0
      org.eclipse.jgit/src/org/eclipse/jgit/hooks/PrePushHook.java

+ 3
- 0
org.eclipse.jgit/src/org/eclipse/jgit/hooks/PrePushHook.java Voir le fichier

@@ -113,6 +113,9 @@ public class PrePushHook extends GitHook<String> {
*/
@Override
protected String[] getParameters() {
if (remoteName == null) {
remoteName = remoteLocation;
}
return new String[] { remoteName, remoteLocation };
}


Chargement…
Annuler
Enregistrer