mirror of
https://github.com/gitbucket/gitbucket.git
synced 2026-01-07 16:12:17 +01:00
Fixed deprecation warning, part 2/2
This commit is contained in:
@@ -740,15 +740,17 @@ object JGitUtil {
|
||||
def getBranchesOfCommit(git: Git, commitId: String): List[String] =
|
||||
using(new RevWalk(git.getRepository)) { revWalk =>
|
||||
defining(revWalk.parseCommit(git.getRepository.resolve(commitId + "^0"))) { commit =>
|
||||
git.getRepository.getAllRefs.entrySet.asScala
|
||||
git.getRepository.getRefDatabase
|
||||
.getRefsByPrefix(Constants.R_HEADS)
|
||||
.asScala
|
||||
.filter { e =>
|
||||
(e.getKey.startsWith(Constants.R_HEADS) && revWalk.isMergedInto(
|
||||
(revWalk.isMergedInto(
|
||||
commit,
|
||||
revWalk.parseCommit(e.getValue.getObjectId)
|
||||
revWalk.parseCommit(e.getObjectId)
|
||||
))
|
||||
}
|
||||
.map { e =>
|
||||
e.getValue.getName.substring(org.eclipse.jgit.lib.Constants.R_HEADS.length)
|
||||
e.getName.substring(Constants.R_HEADS.length)
|
||||
}
|
||||
.toList
|
||||
.sorted
|
||||
@@ -781,15 +783,17 @@ object JGitUtil {
|
||||
def getTagsOfCommit(git: Git, commitId: String): List[String] =
|
||||
using(new RevWalk(git.getRepository)) { revWalk =>
|
||||
defining(revWalk.parseCommit(git.getRepository.resolve(commitId + "^0"))) { commit =>
|
||||
git.getRepository.getAllRefs.entrySet.asScala
|
||||
git.getRepository.getRefDatabase
|
||||
.getRefsByPrefix(Constants.R_TAGS)
|
||||
.asScala
|
||||
.filter { e =>
|
||||
(e.getKey.startsWith(Constants.R_TAGS) && revWalk.isMergedInto(
|
||||
(revWalk.isMergedInto(
|
||||
commit,
|
||||
revWalk.parseCommit(e.getValue.getObjectId)
|
||||
revWalk.parseCommit(e.getObjectId)
|
||||
))
|
||||
}
|
||||
.map { e =>
|
||||
e.getValue.getName.substring(org.eclipse.jgit.lib.Constants.R_TAGS.length)
|
||||
e.getName.substring(Constants.R_TAGS.length)
|
||||
}
|
||||
.toList
|
||||
.sorted
|
||||
|
||||
Reference in New Issue
Block a user