Browse Source

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>
stable-4.10
David Pursehouse 7 years ago
parent
commit
3efea067a3
  1. 3
      org.eclipse.jgit.pgm/resources/org/eclipse/jgit/pgm/internal/CLIText.properties
  2. 2
      org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/RevParse.java
  3. 20
      org.eclipse.jgit/src/org/eclipse/jgit/transport/TransportGitSsh.java

3
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 |\

2
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 {

20
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

Loading…
Cancel
Save