summaryrefslogtreecommitdiffstats
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
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>
-rw-r--r--org.eclipse.jgit.pgm/resources/org/eclipse/jgit/pgm/internal/CLIText.properties3
-rw-r--r--org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/RevParse.java2
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/transport/TransportGitSsh.java20
3 files changed, 16 insertions, 9 deletions
diff --git a/org.eclipse.jgit.pgm/resources/org/eclipse/jgit/pgm/internal/CLIText.properties b/org.eclipse.jgit.pgm/resources/org/eclipse/jgit/pgm/internal/CLIText.properties
index 55ce3e7d13..cb0ea1bc48 100644
--- a/org.eclipse.jgit.pgm/resources/org/eclipse/jgit/pgm/internal/CLIText.properties
+++ b/org.eclipse.jgit.pgm/resources/org/eclipse/jgit/pgm/internal/CLIText.properties
@@ -265,6 +265,9 @@ usage_RepositoryToReceiveInto=Repository to receive into
usage_RevList=List commit objects in reverse chronological order
usage_RevParse=Pick out and massage parameters
usage_RevParseAll=Show all refs found in refs/
+usage_RevParseVerify=Verify that exactly one parameter is provided, and that it can be turned into \
+a raw 20-byte SHA-1 that can be used to access the object database. If so, emit it to the standard \
+output; otherwise, error out.
usage_S3Bucket=S3 bucket name
usage_S3Expiration=Authorization validity in seconds, default 60 sec
usage_S3Region=S3 region (us-east-1 | us-west-1 | us-west-2 | eu-west-1 |\
diff --git a/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/RevParse.java b/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/RevParse.java
index fa9f64de4f..2157034094 100644
--- a/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/RevParse.java
+++ b/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/RevParse.java
@@ -68,7 +68,7 @@ class RevParse extends TextBuiltin {
boolean verify;
@Argument(index = 0, metaVar = "metaVar_commitish")
- private final List<ObjectId> commits = new ArrayList<>();
+ private List<ObjectId> commits = new ArrayList<>();
@Override
protected void run() throws Exception {
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