From a1b4b5b18a6061392fc27b66a5726824212c114c Mon Sep 17 00:00:00 2001 From: orhun Date: Sun, 18 Jul 2021 15:42:13 +0300 Subject: [PATCH] fix(git): sort the commits in topological order --- git-cliff-core/src/repo.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/git-cliff-core/src/repo.rs b/git-cliff-core/src/repo.rs index 20555f7c5e..3529b5dd84 100644 --- a/git-cliff-core/src/repo.rs +++ b/git-cliff-core/src/repo.rs @@ -38,7 +38,7 @@ impl Repository { /// Sorts the commits by their time. pub fn commits(&self, range: Option) -> Result> { let mut revwalk = self.inner.revwalk()?; - revwalk.set_sorting(Sort::TIME)?; + revwalk.set_sorting(Sort::TIME | Sort::TOPOLOGICAL)?; if let Some(range) = range { revwalk.push_range(&range)?; } else {