From df5a39eb2b5bc297742b1ea0341e2e6f6f8fc6dd Mon Sep 17 00:00:00 2001 From: Jordan Doyle Date: Mon, 18 Jul 2022 00:30:57 +0100 Subject: [PATCH] Sort branches by last active & sort tags by creation --- src/git.rs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/git.rs b/src/git.rs index 51b95ee..2c462c2 100644 --- a/src/git.rs +++ a/src/git.rs @@ -211,6 +211,13 @@ } } + built_refs.branch.sort_unstable_by(|one, two| one.commit.committer.time.cmp(&two.commit.committer.time)); + built_refs.tag.sort_unstable_by(|one, two| { + let one_tagger = one.tagger.as_ref().map(|v| v.time); + let two_tagger = two.tagger.as_ref().map(|v| v.time); + one_tagger.cmp(&two_tagger) + }); + Arc::new(built_refs) }) .await -- rgit 0.1.3