remove deprecations and fixed some compiler warnings

This commit is contained in:
Sebastian Sdorra
2017-01-12 20:02:06 +01:00
parent bad99919f4
commit fc6287fd40
17 changed files with 22 additions and 1588 deletions

View File

@@ -377,7 +377,7 @@ public final class GitUtil
try
{
Ref ref = repo.getRef(branchName);
Ref ref = repo.findRef(branchName);
if (ref != null)
{

View File

@@ -216,13 +216,13 @@ public abstract class AbstractGitIncomingOutgoingCommand
if (localBranch != null)
{
ref = repository.getRef(GitUtil.getScmRemoteRefName(remoteRepository,
ref = repository.findRef(GitUtil.getScmRemoteRefName(remoteRepository,
localBranch));
}
}
else
{
ref = repository.getRef(GitUtil.getScmRemoteRefName(remoteRepository,
ref = repository.findRef(GitUtil.getScmRemoteRefName(remoteRepository,
"master"));
if (ref == null)

View File

@@ -43,6 +43,8 @@ import sonia.scm.repository.client.api.RepositoryClientException;
//~--- JDK imports ------------------------------------------------------------
import java.io.IOException;
import org.eclipse.jgit.lib.Ref;
import sonia.scm.repository.GitUtil;
/**
*
@@ -64,29 +66,18 @@ public class GitBranchCommand implements BranchCommand
//~--- methods --------------------------------------------------------------
/**
* Method description
*
*
* @param name
*
* @return
*
* @throws IOException
*/
@Override
public Branch branch(String name) throws IOException
{
try
{
git.branchCreate().setName(name).call();
Ref ref = git.branchCreate().setName(name).call();
return new Branch(name, GitUtil.getId(ref.getObjectId()));
}
catch (GitAPIException ex)
{
throw new RepositoryClientException("could not create branch", ex);
}
return new Branch(name);
}
//~--- fields ---------------------------------------------------------------