mirror of
https://github.com/scm-manager/scm-manager.git
synced 2026-01-18 05:22:10 +01:00
Cleanup
This commit is contained in:
@@ -394,22 +394,15 @@ public final class GitUtil
|
||||
*/
|
||||
public static Long getTagTime(org.eclipse.jgit.lib.Repository repository, ObjectId objectId) throws IOException {
|
||||
try (RevWalk walk = new RevWalk(repository)) {
|
||||
return GitUtil.getTagTime(repository, walk, objectId);
|
||||
return GitUtil.getTagTime(walk, objectId);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @since 2.5.0
|
||||
*/
|
||||
public static Long getTagTime(org.eclipse.jgit.lib.Repository repository,
|
||||
RevWalk revWalk, ObjectId objectId)
|
||||
throws IOException {
|
||||
|
||||
public static Long getTagTime(RevWalk revWalk, ObjectId objectId) throws IOException {
|
||||
if (objectId != null) {
|
||||
if (revWalk == null) {
|
||||
revWalk = new RevWalk(repository);
|
||||
}
|
||||
|
||||
final RevObject revObject = revWalk.parseAny(objectId);
|
||||
if (revObject instanceof RevTag) {
|
||||
return ((RevTag) revObject).getTaggerIdent().getWhen().getTime();
|
||||
|
||||
@@ -132,7 +132,7 @@ public class GitTagsCommand extends AbstractGitCommand implements TagsCommand {
|
||||
if (revObject != null) {
|
||||
String name = GitUtil.getTagName(ref);
|
||||
|
||||
tag = new Tag(name, revObject.getId().name(), GitUtil.getTagTime(repository, revWalk, ref.getObjectId()));
|
||||
tag = new Tag(name, revObject.getId().name(), GitUtil.getTagTime(revWalk, ref.getObjectId()));
|
||||
}
|
||||
|
||||
} catch (IOException ex) {
|
||||
|
||||
Reference in New Issue
Block a user