Skip to content

Commit bd1fcaa

Browse files
committed
Improve finding last git tag
1 parent 36b67dd commit bd1fcaa

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/main/java/com/amashchenko/maven/plugin/gitflow/AbstractGitFlowMojo.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -501,8 +501,8 @@ protected String gitFindTags() throws MojoFailureException, CommandLineException
501501
* @throws CommandLineException
502502
*/
503503
protected String gitFindLastTag() throws MojoFailureException, CommandLineException {
504-
String tag = executeGitCommandReturn("for-each-ref", "--sort=-*authordate", "--count=1",
505-
"--format=\"%(refname:short)\"", "refs/tags/");
504+
String tag = executeGitCommandReturn("for-each-ref", "--sort=\"-version:refname\"", "--sort=-taggerdate",
505+
"--count=1", "--format=\"%(refname:short)\"", "refs/tags/");
506506
// https://github.com/aleksandr-m/gitflow-maven-plugin/issues/3
507507
tag = removeQuotes(tag);
508508
tag = tag.replaceAll("\\r?\\n", "");

0 commit comments

Comments
 (0)