Skip to content

Commit

Permalink
Restore trailing slash after a or b
Browse files Browse the repository at this point in the history
  • Loading branch information
jglick committed Feb 9, 2023
1 parent 8be1af4 commit 1ab538d
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 1ab538d

Please sign in to comment.