mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-11-06 21:45:43 +01:00
remove deprecations and fixed some compiler warnings
This commit is contained in:
@@ -377,7 +377,7 @@ public final class GitUtil
|
||||
|
||||
try
|
||||
{
|
||||
Ref ref = repo.getRef(branchName);
|
||||
Ref ref = repo.findRef(branchName);
|
||||
|
||||
if (ref != null)
|
||||
{
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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 ---------------------------------------------------------------
|
||||
|
||||
Reference in New Issue
Block a user