diff --git a/src/main/kotlin/nl/avisi/structurizr/site/generatr/GenerateSiteCommand.kt b/src/main/kotlin/nl/avisi/structurizr/site/generatr/GenerateSiteCommand.kt index 5103d43f..51c257b5 100644 --- a/src/main/kotlin/nl/avisi/structurizr/site/generatr/GenerateSiteCommand.kt +++ b/src/main/kotlin/nl/avisi/structurizr/site/generatr/GenerateSiteCommand.kt @@ -143,5 +143,5 @@ class GenerateSiteCommand : Subcommand( fun branchComparator(defaultBranch: String) = Comparator { a, b -> if (a == defaultBranch) -1 else if (b == defaultBranch) 1 - else a.compareTo(b) + else a.compareTo(b, ignoreCase = true) } diff --git a/src/test/kotlin/nl/avisi/structurizr/site/generatr/site/BranchComparatorTest.kt b/src/test/kotlin/nl/avisi/structurizr/site/generatr/site/BranchComparatorTest.kt index 4c0aa111..2c7d7f91 100644 --- a/src/test/kotlin/nl/avisi/structurizr/site/generatr/site/BranchComparatorTest.kt +++ b/src/test/kotlin/nl/avisi/structurizr/site/generatr/site/BranchComparatorTest.kt @@ -9,16 +9,16 @@ import org.junit.jupiter.api.TestFactory class BranchComparatorTest { @TestFactory fun `default branch first then by string`() = listOf( - listOf("a", "b", "main"), - listOf("a", "main", "b"), - listOf("b", "a", "main"), - listOf("b", "main", "a"), - listOf("main", "a", "b"), - listOf("main", "b", "a") + listOf("a", "B", "main"), + listOf("a", "main", "B"), + listOf("B", "a", "main"), + listOf("B", "main", "a"), + listOf("main", "a", "B"), + listOf("main", "B", "a"), ).map { branches -> DynamicTest.dynamicTest(branches.toString()) { assertThat(branches.sortedWith(branchComparator("main"))) - .containsExactly("main", "a", "b") + .containsExactly("main", "a", "B") } } }