Skip to content

Commit

Permalink
Merge pull request #35 from jglick/trailing-slash
Browse files Browse the repository at this point in the history
Restore trailing slash after `a` or `b`
  • Loading branch information
jglick committed Feb 9, 2023
2 parents 8be1af4 + 1ab538d commit f724edc
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ public void afterSessionStart(MavenSession session) throws MavenExecutionExcepti
}

static String sanitize(String hash) {
return hash.replaceAll("[ab]", "$0_").replaceAll("_$", "");
return hash.replaceAll("[ab]", "$0_");
}

private static String summarize(RevCommit c) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ public class MainTest {
@Test public void alphaBetaTrailing() {
String hash = "852b473a2bcb";
String sanitized = Main.sanitize(hash);
assertThat(hash + " has been sanitized to the expected format", sanitized, is("852b_473a_2b_cb"));
assertThat(hash + " has been sanitized to the expected format", sanitized, is("852b_473a_2b_cb_"));
String canonical = new ComparableVersion(sanitized).getCanonical();
for (String prerelease : PRERELEASE) {
assertThat(sanitized + " treated as a prerelease", canonical, not(containsString(prerelease)));
Expand Down

0 comments on commit f724edc

Please sign in to comment.