remove unused imports

This commit is contained in:
Sebastian Sdorra
2012-07-05 20:44:06 +02:00
parent e5ee84cebe
commit 3e4b0d19a3
2 changed files with 13 additions and 19 deletions

View File

@@ -38,20 +38,12 @@ package sonia.scm.repository.spi;
import com.google.common.base.Strings; import com.google.common.base.Strings;
import com.google.common.collect.Lists; import com.google.common.collect.Lists;
import org.eclipse.jgit.api.Git;
import org.eclipse.jgit.api.errors.GitAPIException;
import org.eclipse.jgit.api.errors.NoHeadException;
import org.eclipse.jgit.errors.IncorrectObjectTypeException;
import org.eclipse.jgit.errors.MissingObjectException;
import org.eclipse.jgit.errors.StopWalkException;
import org.eclipse.jgit.lib.ObjectId; import org.eclipse.jgit.lib.ObjectId;
import org.eclipse.jgit.lib.Repository; import org.eclipse.jgit.lib.Repository;
import org.eclipse.jgit.revwalk.RevCommit; import org.eclipse.jgit.revwalk.RevCommit;
import org.eclipse.jgit.revwalk.RevWalk; import org.eclipse.jgit.revwalk.RevWalk;
import org.eclipse.jgit.revwalk.filter.RevFilter;
import org.eclipse.jgit.treewalk.filter.AndTreeFilter; import org.eclipse.jgit.treewalk.filter.AndTreeFilter;
import org.eclipse.jgit.treewalk.filter.PathFilter; import org.eclipse.jgit.treewalk.filter.PathFilter;
import org.eclipse.jgit.treewalk.filter.PathFilterGroup;
import org.eclipse.jgit.treewalk.filter.TreeFilter; import org.eclipse.jgit.treewalk.filter.TreeFilter;
import org.slf4j.Logger; import org.slf4j.Logger;
@@ -68,7 +60,6 @@ import sonia.scm.util.IOUtil;
import java.io.IOException; import java.io.IOException;
import java.util.ArrayList;
import java.util.Iterator; import java.util.Iterator;
import java.util.List; import java.util.List;
@@ -170,7 +161,7 @@ public class GitLogCommand extends AbstractGitCommand implements LogCommand
*/ */
@Override @Override
public ChangesetPagingResult getChangesets(LogCommandRequest request) public ChangesetPagingResult getChangesets(LogCommandRequest request)
throws IOException, RepositoryException throws IOException, RepositoryException
{ {
if (logger.isDebugEnabled()) if (logger.isDebugEnabled())
{ {
@@ -222,8 +213,8 @@ public class GitLogCommand extends AbstractGitCommand implements LogCommand
if (!Strings.isNullOrEmpty(request.getPath())) if (!Strings.isNullOrEmpty(request.getPath()))
{ {
revWalk.setTreeFilter( revWalk.setTreeFilter(
AndTreeFilter.create( AndTreeFilter.create(
PathFilter.create(request.getPath()), TreeFilter.ANY_DIFF)); PathFilter.create(request.getPath()), TreeFilter.ANY_DIFF));
} }
ObjectId head = GitUtil.getRepositoryHead(gr); ObjectId head = GitUtil.getRepositoryHead(gr);
@@ -246,7 +237,7 @@ public class GitLogCommand extends AbstractGitCommand implements LogCommand
RevCommit commit = iterator.next(); RevCommit commit = iterator.next();
if ((counter >= start) if ((counter >= start)
&& ((limit < 0) || (counter < start + limit))) && ((limit < 0) || (counter < start + limit)))
{ {
changesetList.add(converter.createChangeset(commit)); changesetList.add(converter.createChangeset(commit));
} }
@@ -265,7 +256,7 @@ public class GitLogCommand extends AbstractGitCommand implements LogCommand
else if (logger.isWarnEnabled()) else if (logger.isWarnEnabled())
{ {
logger.warn("the repository {} seems to be empty", logger.warn("the repository {} seems to be empty",
repository.getName()); repository.getName());
} }
} }
catch (Exception ex) catch (Exception ex)

View File

@@ -38,7 +38,7 @@ import com.google.common.collect.Lists;
import org.eclipse.jgit.api.Git; import org.eclipse.jgit.api.Git;
import org.eclipse.jgit.api.errors.GitAPIException; import org.eclipse.jgit.api.errors.GitAPIException;
import org.eclipse.jgit.revwalk.RevTag; import org.eclipse.jgit.lib.Ref;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
@@ -52,7 +52,6 @@ import sonia.scm.repository.Tag;
import java.io.IOException; import java.io.IOException;
import java.util.List; import java.util.List;
import org.eclipse.jgit.lib.Ref;
/** /**
* *
@@ -61,6 +60,9 @@ import org.eclipse.jgit.lib.Ref;
public class GitTagsCommand extends AbstractGitCommand implements TagsCommand public class GitTagsCommand extends AbstractGitCommand implements TagsCommand
{ {
/** Field description */
private static final String PREFIX_TAG = "refs/tags/";
/** /**
* the logger for GitTagsCommand * the logger for GitTagsCommand
*/ */
@@ -83,8 +85,6 @@ public class GitTagsCommand extends AbstractGitCommand implements TagsCommand
//~--- get methods ---------------------------------------------------------- //~--- get methods ----------------------------------------------------------
private static final String PREFIX_TAG = "refs/tags/";
/** /**
* Method description * Method description
* *
@@ -111,9 +111,12 @@ public class GitTagsCommand extends AbstractGitCommand implements TagsCommand
public Tag apply(Ref input) public Tag apply(Ref input)
{ {
String name = input.getName(); String name = input.getName();
if ( name.startsWith(PREFIX_TAG) ){
if (name.startsWith(PREFIX_TAG))
{
name = name.substring(PREFIX_TAG.length()); name = name.substring(PREFIX_TAG.length());
} }
return new Tag(name, input.getObjectId().name()); return new Tag(name, input.getObjectId().name());
} }