From fd53b454f230d70a319f32f6d5524268e0338ca6 Mon Sep 17 00:00:00 2001 From: Robin Rosenberg Date: Fri, 9 Mar 2012 12:03:20 +0100 Subject: Fix broken TagCommand API Tags can be un-annotated whereby there is no RevTag object, only a ref pointing to the tagged object. Bug: 360650 Change-Id: I06309c45c0a896fe2a0a874700febf78c9fb87e8 --- org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Tag.java | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'org.eclipse.jgit.pgm/src') diff --git a/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Tag.java b/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Tag.java index 4bfc56cc48..1489e47d1c 100644 --- a/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Tag.java +++ b/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Tag.java @@ -54,7 +54,8 @@ import org.eclipse.jgit.api.Git; import org.eclipse.jgit.api.ListTagCommand; import org.eclipse.jgit.api.TagCommand; import org.eclipse.jgit.lib.ObjectId; -import org.eclipse.jgit.revwalk.RevTag; +import org.eclipse.jgit.lib.Ref; +import org.eclipse.jgit.lib.Repository; import org.eclipse.jgit.revwalk.RevWalk; import org.kohsuke.args4j.Argument; import org.kohsuke.args4j.Option; @@ -88,9 +89,9 @@ class Tag extends TextBuiltin { command.call(); } else { ListTagCommand command = git.tagList(); - List list = command.call(); - for (RevTag revTag : list) { - out.println(revTag.getTagName()); + List list = command.call(); + for (Ref ref : list) { + out.println(Repository.shortenRefName(ref.getName())); } } } -- cgit v1.2.3