Update to JGit 0.8.4.240-g8e9cc82

Change-Id: Id43a1846b31bb1aad40ca0ae295a268fcacd162f
Signed-off-by: Shawn O. Pearce <sop@google.com>
This commit is contained in:
Shawn O. Pearce
2010-08-05 17:57:35 -07:00
parent 91c1532130
commit 5f11b2954c
26 changed files with 255 additions and 118 deletions

View File

@@ -26,6 +26,7 @@ import com.google.gerrit.server.PeerDaemonUser;
import com.google.gerrit.server.RemotePeer;
import com.google.gerrit.server.config.FactoryModule;
import com.google.gerrit.server.config.GerritRequestModule;
import com.google.gerrit.server.git.TransferConfig;
import com.google.gerrit.server.git.WorkQueue;
import com.google.gerrit.server.project.ProjectControl;
import com.google.gerrit.server.ssh.SshInfo;
@@ -77,7 +78,6 @@ public class SshModule extends FactoryModule {
bind(PublickeyAuthenticator.class).to(DatabasePubKeyAuth.class);
bind(KeyPairProvider.class).toProvider(HostKeyProvider.class).in(SINGLETON);
bind(TransferConfig.class);
install(new DefaultCommandModule());

View File

@@ -1,40 +0,0 @@
// Copyright (C) 2010 The Android Open Source Project
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package com.google.gerrit.sshd;
import com.google.gerrit.server.config.ConfigUtil;
import com.google.gerrit.server.config.GerritServerConfig;
import com.google.inject.Inject;
import com.google.inject.Singleton;
import org.eclipse.jgit.lib.Config;
import java.util.concurrent.TimeUnit;
@Singleton
public class TransferConfig {
private final int timeout;
@Inject
TransferConfig(@GerritServerConfig final Config cfg) {
timeout = (int) ConfigUtil.getTimeUnit(cfg, "transfer", null, "timeout", //
0, TimeUnit.SECONDS);
}
/** @return configured timeout, in seconds. 0 if the timeout is infinite. */
public int getTimeout() {
return timeout;
}
}

View File

@@ -21,7 +21,7 @@ import net.sf.ehcache.Statistics;
import net.sf.ehcache.config.CacheConfiguration;
import org.apache.sshd.server.Environment;
import org.eclipse.jgit.lib.WindowCacheStatAccessor;
import org.eclipse.jgit.storage.file.WindowCacheStatAccessor;
import java.io.PrintWriter;

View File

@@ -17,8 +17,8 @@ package com.google.gerrit.sshd.commands;
import com.google.gerrit.reviewdb.Account;
import com.google.gerrit.server.IdentifiedUser;
import com.google.gerrit.server.git.ReceiveCommits;
import com.google.gerrit.server.git.TransferConfig;
import com.google.gerrit.sshd.AbstractGitCommand;
import com.google.gerrit.sshd.TransferConfig;
import com.google.inject.Inject;
import org.eclipse.jgit.transport.ReceivePack;

View File

@@ -15,9 +15,9 @@
package com.google.gerrit.sshd.commands;
import com.google.gerrit.reviewdb.ReviewDb;
import com.google.gerrit.server.git.TransferConfig;
import com.google.gerrit.server.git.VisibleRefFilter;
import com.google.gerrit.sshd.AbstractGitCommand;
import com.google.gerrit.sshd.TransferConfig;
import com.google.inject.Inject;
import com.google.inject.Provider;
@@ -40,6 +40,7 @@ final class Upload extends AbstractGitCommand {
if (!projectControl.allRefsAreVisible()) {
up.setRefFilter(new VisibleRefFilter(repo, projectControl, db.get()));
}
up.setPackConfig(config.getPackConfig());
up.setTimeout(config.getTimeout());
try {
up.upload(in, out, err);