From 08b991702febefc8682bbca60fe813df8e29d8cb Mon Sep 17 00:00:00 2001
From: James Moger <james.moger@gitblit.com>
Date: Tue, 01 Jul 2014 09:29:10 -0400
Subject: [PATCH] Merge branch 'ticket/121' into develop
---
src/main/java/com/gitblit/transport/ssh/SshDaemon.java | 13 +++++++------
1 files changed, 7 insertions(+), 6 deletions(-)
diff --git a/src/main/java/com/gitblit/transport/ssh/SshDaemon.java b/src/main/java/com/gitblit/transport/ssh/SshDaemon.java
index a403699..261daa6 100644
--- a/src/main/java/com/gitblit/transport/ssh/SshDaemon.java
+++ b/src/main/java/com/gitblit/transport/ssh/SshDaemon.java
@@ -41,9 +41,9 @@
import com.gitblit.Keys;
import com.gitblit.manager.IGitblit;
import com.gitblit.transport.ssh.commands.SshCommandFactory;
-import com.gitblit.utils.IdGenerator;
import com.gitblit.utils.JnaUtils;
import com.gitblit.utils.StringUtils;
+import com.gitblit.utils.WorkQueue;
import com.google.common.io.Files;
/**
@@ -76,8 +76,9 @@
* Construct the Gitblit SSH daemon.
*
* @param gitblit
+ * @param workQueue
*/
- public SshDaemon(IGitblit gitblit, IdGenerator idGenerator) {
+ public SshDaemon(IGitblit gitblit, WorkQueue workQueue) {
this.gitblit = gitblit;
IStoredSettings settings = gitblit.getSettings();
@@ -126,7 +127,7 @@
sshd.setSessionFactory(new SshServerSessionFactory());
sshd.setFileSystemFactory(new DisabledFilesystemFactory());
sshd.setTcpipForwardingFilter(new NonForwardingFilter());
- sshd.setCommandFactory(new SshCommandFactory(gitblit, idGenerator));
+ sshd.setCommandFactory(new SshCommandFactory(gitblit, workQueue));
sshd.setShellFactory(new WelcomeShell(settings));
// Set the server id. This can be queried with:
@@ -141,7 +142,7 @@
public String formatUrl(String gituser, String servername, String repository) {
if (sshd.getPort() == DEFAULT_PORT) {
// standard port
- return MessageFormat.format("{0}@{1}/{2}", gituser, servername,
+ return MessageFormat.format("ssh://{0}@{1}/{2}", gituser, servername,
repository);
} else {
// non-standard port
@@ -212,8 +213,8 @@
Files.touch(file);
try {
JnaUtils.setFilemode(file, JnaUtils.S_IRUSR | JnaUtils.S_IWUSR);
- } catch (UnsupportedOperationException e) {
- // Windows
+ } catch (UnsatisfiedLinkError | UnsupportedOperationException e) {
+ // Unexpected/Unsupported OS or Architecture
}
FileOutputStream os = new FileOutputStream(file);
--
Gitblit v1.9.1