From 7baf2e4cd2ef8082b74937e26de75b01e630b5d4 Mon Sep 17 00:00:00 2001 From: James Moger <james.moger@gitblit.com> Date: Thu, 17 Apr 2014 12:00:35 -0400 Subject: [PATCH] Expose JGit 3.x receive pack settings as Gitblit settings --- src/main/java/com/gitblit/transport/ssh/git/BaseGitCommand.java | 17 ++++++++++++----- 1 files changed, 12 insertions(+), 5 deletions(-) diff --git a/src/main/java/com/gitblit/transport/ssh/git/BaseGitCommand.java b/src/main/java/com/gitblit/transport/ssh/git/BaseGitCommand.java index b203d47..029dd73 100644 --- a/src/main/java/com/gitblit/transport/ssh/git/BaseGitCommand.java +++ b/src/main/java/com/gitblit/transport/ssh/git/BaseGitCommand.java @@ -1,4 +1,5 @@ /* + * Copyright (C) 2009 The Android Open Source Project * Copyright 2014 gitblit.com. * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -29,10 +30,6 @@ import com.gitblit.transport.ssh.SshDaemonClient; import com.gitblit.transport.ssh.commands.BaseCommand; -/** - * @author Eric Myhre - * - */ abstract class BaseGitCommand extends BaseCommand { @Argument(index = 0, metaVar = "REPOSITORY", required = true, usage = "repository name") protected String repository; @@ -42,6 +39,16 @@ protected UploadPackFactory<SshDaemonClient> uploadPackFactory; protected Repository repo; + + @Override + public void destroy() { + super.destroy(); + + repositoryResolver = null; + receivePackFactory = null; + uploadPackFactory = null; + repo = null; + } @Override public void start(final Environment env) { @@ -84,7 +91,7 @@ } repository = repository.substring(1); try { - return repositoryResolver.open(ctx.getClient(), repository); + return repositoryResolver.open(getContext().getClient(), repository); } catch (Exception e) { throw new Failure(1, "fatal: '" + repository + "': not a git archive", e); } -- Gitblit v1.9.1