Mind review findings

This commit is contained in:
Eduard Heimbuch
2020-12-02 10:42:26 +01:00
parent e7b7bf5b0f
commit 7db33d2e65
18 changed files with 152 additions and 351 deletions

View File

@@ -31,6 +31,7 @@ import org.slf4j.LoggerFactory;
/**
* @author Sebastian Sdorra
* @deprecated
*/
@Deprecated
public class GitImportHandler extends AbstactImportHandler {

View File

@@ -43,7 +43,6 @@ import org.slf4j.LoggerFactory;
import sonia.scm.ContextEntry;
import sonia.scm.repository.GitRepositoryHandler;
import sonia.scm.repository.GitUtil;
import sonia.scm.repository.InternalRepositoryException;
import sonia.scm.repository.Repository;
import sonia.scm.repository.api.ImportFailedException;
import sonia.scm.repository.api.PullResponse;
@@ -217,15 +216,11 @@ public class GitPullCommand extends AbstractGitPushOrPullCommand
response = convert(git, result);
} catch
(GitAPIException ex) {
if (ex.getMessage().contains("not authorized")) {
throw new ImportFailedException(
ContextEntry.ContextBuilder.entity(repository).build(),
"Repository import failed. The credentials are wrong or missing.",
ex
);
}
throw new InternalRepositoryException(repository, "error during pull", ex);
throw new ImportFailedException(
ContextEntry.ContextBuilder.entity(repository).build(),
"Repository import failed. The credentials are wrong or missing.",
ex
);
}
return response;