aboutsummaryrefslogtreecommitdiffstats
path: root/org.eclipse.jgit/src
diff options
context:
space:
mode:
authorDavid Pursehouse <david.pursehouse@gmail.com>2017-11-20 15:38:43 +0900
committerDavid Pursehouse <david.pursehouse@gmail.com>2017-11-20 15:38:43 +0900
commit3efea067a3db7e3bdfadd47d5420deaf9a35d740 (patch)
treeb08149a42de3979a5e69ca79afe7d46c7efa1bd8 /org.eclipse.jgit/src
parent7bf8f526996c1a39c4e05f59a1d6bcbc76983eb6 (diff)
parent29c5f49f635f136c4595d43af74dd6106ad53c19 (diff)
downloadjgit-3efea067a3db7e3bdfadd47d5420deaf9a35d740.tar.gz
jgit-3efea067a3db7e3bdfadd47d5420deaf9a35d740.zip
Merge branch 'stable-4.9'
* stable-4.9: Fix NPE in TransportGitSsh.ExtSession.exec() Add missing help text for rev-parse's --verify option Remove final modifier on args4j argument field in RevParse Change-Id: I5ac9e2f185f2210ee76970501710b99b12e93e75 Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
Diffstat (limited to 'org.eclipse.jgit/src')
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/transport/TransportGitSsh.java20
1 files changed, 12 insertions, 8 deletions
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/transport/TransportGitSsh.java b/org.eclipse.jgit/src/org/eclipse/jgit/transport/TransportGitSsh.java
index 24bc058c41..b1b910ea22 100644
--- a/org.eclipse.jgit/src/org/eclipse/jgit/transport/TransportGitSsh.java
+++ b/org.eclipse.jgit/src/org/eclipse/jgit/transport/TransportGitSsh.java
@@ -242,14 +242,7 @@ public class TransportGitSsh extends SshTransport implements PackTransport {
args.add(getURI().getHost());
args.add(command);
- ProcessBuilder pb = new ProcessBuilder();
- pb.command(args);
-
- File directory = local.getDirectory();
- if (directory != null)
- pb.environment().put(Constants.GIT_DIR_KEY,
- directory.getPath());
-
+ ProcessBuilder pb = createProcess(args);
try {
return pb.start();
} catch (IOException err) {
@@ -257,6 +250,17 @@ public class TransportGitSsh extends SshTransport implements PackTransport {
}
}
+ private ProcessBuilder createProcess(List<String> args) {
+ ProcessBuilder pb = new ProcessBuilder();
+ pb.command(args);
+ File directory = local != null ? local.getDirectory() : null;
+ if (directory != null) {
+ pb.environment().put(Constants.GIT_DIR_KEY,
+ directory.getPath());
+ }
+ return pb;
+ }
+
@Override
public void disconnect() {
// Nothing to do