mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-12-21 15:59:48 +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) {
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
|
||||
package sonia.scm.repository.client.spi;
|
||||
|
||||
//~--- non-JDK imports --------------------------------------------------------
|
||||
@@ -89,7 +89,7 @@ public class GitTagCommand implements TagCommand
|
||||
{
|
||||
walk = new RevWalk(git.getRepository());
|
||||
revObject = walk.parseAny(id);
|
||||
tagTime = GitUtil.getTagTime(git.getRepository(), walk, id);
|
||||
tagTime = GitUtil.getTagTime(walk, id);
|
||||
}
|
||||
finally
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user