summaryrefslogtreecommitdiffstats
path: root/org.eclipse.jgit.pgm/src
diff options
context:
space:
mode:
authorRobin Rosenberg <robin.rosenberg@dewire.com>2012-03-09 12:03:20 +0100
committerRobin Rosenberg <robin.rosenberg@dewire.com>2012-04-06 00:52:20 +0200
commitfd53b454f230d70a319f32f6d5524268e0338ca6 (patch)
tree86e5b778f3ee43a856f546e03ec114b7d398352b /org.eclipse.jgit.pgm/src
parente0531ace35b9c8eca9ded0a7b1540de3c49dbde6 (diff)
downloadjgit-fd53b454f230d70a319f32f6d5524268e0338ca6.tar.gz
jgit-fd53b454f230d70a319f32f6d5524268e0338ca6.zip
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
Diffstat (limited to 'org.eclipse.jgit.pgm/src')
-rw-r--r--org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Tag.java9
1 files changed, 5 insertions, 4 deletions
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<RevTag> list = command.call();
- for (RevTag revTag : list) {
- out.println(revTag.getTagName());
+ List<Ref> list = command.call();
+ for (Ref ref : list) {
+ out.println(Repository.shortenRefName(ref.getName()));
}
}
}