pass supported repository commands to scm state

This commit is contained in:
Sebastian Sdorra
2012-08-03 07:50:04 +02:00
parent f6dac33e22
commit d919338cc2
7 changed files with 125 additions and 27 deletions

View File

@@ -44,6 +44,7 @@ import org.eclipse.jgit.storage.file.FileRepositoryBuilder;
import sonia.scm.Type;
import sonia.scm.io.FileSystem;
import sonia.scm.plugin.ext.Extension;
import sonia.scm.repository.spi.GitRepositoryServiceProvider;
import sonia.scm.store.StoreFactory;
import sonia.scm.util.AssertUtil;
@@ -59,7 +60,7 @@ import java.io.IOException;
@Singleton
@Extension
public class GitRepositoryHandler
extends AbstractSimpleRepositoryHandler<GitConfig>
extends AbstractSimpleRepositoryHandler<GitConfig>
{
/** Field description */
@@ -76,7 +77,9 @@ public class GitRepositoryHandler
public static final String TYPE_NAME = "git";
/** Field description */
public static final Type TYPE = new Type(TYPE_NAME, TYPE_DISPLAYNAME);
public static final Type TYPE = new RepositoryType(TYPE_NAME,
TYPE_DISPLAYNAME,
GitRepositoryServiceProvider.COMMANDS);
//~--- constructors ---------------------------------------------------------
@@ -254,7 +257,7 @@ public class GitRepositoryHandler
*/
@Override
protected void create(Repository repository, File directory)
throws RepositoryException, IOException
throws RepositoryException, IOException
{
FileRepository fr = null;

View File

@@ -55,7 +55,7 @@ public class GitRepositoryServiceProvider extends RepositoryServiceProvider
{
/** Field description */
private static final Set<Command> COMMANDS = ImmutableSet.of(Command.BLAME,
public static final Set<Command> COMMANDS = ImmutableSet.of(Command.BLAME,
Command.BROWSE, Command.CAT,
Command.DIFF, Command.LOG,
Command.TAGS,