fix order of commit references - fixes #375

Wed, 07 Aug 2024 18:02:38 +0200

author
Mike Becker <universe@uap-core.de>
date
Wed, 07 Aug 2024 18:02:38 +0200
changeset 317
c2d7a9079853
parent 316
3ddc29ec33cd
child 318
50052f2fbb3f

fix order of commit references - fixes #375

src/main/kotlin/de/uapcore/lightpit/types/CommitRef.kt file | annotate | diff | comparison | revisions
src/test/kotlin/de/uapcore/lightpit/types/CommitRefTest.kt file | annotate | diff | comparison | revisions
--- a/src/main/kotlin/de/uapcore/lightpit/types/CommitRef.kt	Wed Aug 07 18:01:11 2024 +0200
+++ b/src/main/kotlin/de/uapcore/lightpit/types/CommitRef.kt	Wed Aug 07 18:02:38 2024 +0200
@@ -58,7 +58,7 @@
             .map { it.groupValues[1] }
             .map { it.toIntOrNull() }
             .filterNotNull()
-            .forEach { commitId -> add(CommitRef(currentHash, commitId, currentDesc)) }
+            .forEach { commitId -> addFirst(CommitRef(currentHash, commitId, currentDesc)) }
     }
 }
 
--- a/src/test/kotlin/de/uapcore/lightpit/types/CommitRefTest.kt	Wed Aug 07 18:01:11 2024 +0200
+++ b/src/test/kotlin/de/uapcore/lightpit/types/CommitRefTest.kt	Wed Aug 07 18:02:38 2024 +0200
@@ -47,7 +47,7 @@
                 CommitRef("74d770da3c80c0c3fc1fb7e44fb710d665127dfe", 13, "a change with commitrefs only in body"),
                 CommitRef("9a14e5628bdf2d578f3385d78022ddcaf23d1abb", 47, "add test file - closed #47 and fixed #90"),
                 CommitRef("9a14e5628bdf2d578f3385d78022ddcaf23d1abb", 90, "add test file - closed #47 and fixed #90")
-            ),
+            ).reversed(),
             parseCommitRefs("""
 ::lpitref:cf9f5982ddeb28c7f695dc547fe73abf5460016f:here we fix #50
 

mercurial