[gitg] Sort remote refs



commit df267aa4b056cacfd66bb32ad439771e8f7c980e
Author: Jesse van den Kieboom <jesse vandenkieboom epfl ch>
Date:   Tue Oct 16 21:10:17 2012 +0200

    Sort remote refs

 plugins/history/gitg-history-navigation.vala |    9 +++++++++
 1 files changed, 9 insertions(+), 0 deletions(-)
---
diff --git a/plugins/history/gitg-history-navigation.vala b/plugins/history/gitg-history-navigation.vala
index 45ff80c..012f6e2 100644
--- a/plugins/history/gitg-history-navigation.vala
+++ b/plugins/history/gitg-history-navigation.vala
@@ -39,6 +39,11 @@ namespace GitgHistory
 			return a.parsed_name.shortname.ascii_casecmp(b.parsed_name.shortname);
 		}
 
+		private static int sort_remote_refs(Gitg.Ref a, Gitg.Ref b)
+		{
+			return a.parsed_name.remote_branch.ascii_casecmp(b.parsed_name.remote_branch);
+		}
+
 		public void populate(GitgExt.NavigationTreeModel model)
 		{
 			var repo = application.repository;
@@ -163,6 +168,10 @@ namespace GitgHistory
 			{
 				model.begin_header(rname, null);
 
+				var rrefs = remotes.lookup(rname);
+
+				rrefs.sort((CompareFunc)sort_remote_refs);
+
 				foreach (var rref in remotes.lookup(rname))
 				{
 					var it = rref;



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]