File tree Expand file tree Collapse file tree
src/main/java/hudson/plugins/git Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -979,16 +979,16 @@ public Repository getRepository() throws IOException {
979979 return new FileRepository (new File (workspace .getRemote (), Constants .DOT_GIT ));
980980 }
981981
982- public List <Tag > getTagsOnCommit (String revName ) throws GitException , IOException {
983- Repository db = getRepository ();
984- ObjectId commit = db .resolve (revName );
985- List <Tag > ret = new ArrayList <Tag >();
982+ public List <Tag > getTagsOnCommit (final String revName ) throws GitException ,
983+ IOException {
984+ final Repository db = getRepository ();
985+ final ObjectId commit = db .resolve (revName );
986+ final List <Tag > ret = new ArrayList <Tag >();
986987
987988 for (final Map .Entry <String , Ref > tag : db .getTags ().entrySet ()) {
988-
989- Ref ref = db .getTags ().get ( tag .getKey () );
990- if ( ref .getObjectId ().equals (commit ) )
991- ret .add ( new Tag ( tag .getKey (), ref .getObjectId () ) );
989+ final ObjectId tagId = tag .getValue ().getObjectId ();
990+ if (commit .equals (tagId ))
991+ ret .add (new Tag (tag .getKey (), tagId ));
992992 }
993993 return ret ;
994994 }
You can’t perform that action at this time.
0 commit comments