From 3db3b95dd0a26e8818ade33c4a4edc2f35e96a73 Mon Sep 17 00:00:00 2001 From: Stephan Dilly Date: Sat, 21 Aug 2021 15:56:21 +0200 Subject: [PATCH] fix order of old/new in compare --- src/components/commit_details/compare_details.rs | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/components/commit_details/compare_details.rs b/src/components/commit_details/compare_details.rs index 26605b9f..cfa356b1 100644 --- a/src/components/commit_details/compare_details.rs +++ b/src/components/commit_details/compare_details.rs @@ -52,7 +52,15 @@ impl CompareDetailsComponent { let c1 = sync::get_commit_details(CWD, ids.0).ok(); let c2 = sync::get_commit_details(CWD, ids.1).ok(); - c1.and_then(|c1| c2.map(|c2| (c1, c2))) + c1.and_then(|c1| { + c2.map(|c2| { + if c1.author.time < c2.author.time { + (c1, c2) + } else { + (c2, c1) + } + }) + }) }); }