File tree Expand file tree Collapse file tree 1 file changed +10
-2
lines changed
Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -157,13 +157,17 @@ namespace Scratch.Services {
157157 return " " ;
158158 }
159159
160+ // Returns an alphabetically sorted list of local branch names
160161 public unowned List<string> get_local_branches () {
161162 unowned List<string> branches = null ;
162163 try {
163164 var branch_enumerator = git_repo. enumerate_branches (Ggit . BranchType . LOCAL );
164165 foreach (Ggit . Ref branch_ref in branch_enumerator) {
165166 if (branch_ref is Ggit . Branch ) {
166- branches. append (((Ggit . Branch )branch_ref). get_name ());
167+ branches. insert_sorted (
168+ ((Ggit . Branch )branch_ref). get_name (),
169+ string . collate
170+ );
167171 }
168172 }
169173 } catch (Error e) {
@@ -173,6 +177,7 @@ namespace Scratch.Services {
173177 return branches;
174178 }
175179
180+ // Returns an alphabetically sorted list of remote branch names
176181 public unowned List<string> get_remote_branches () {
177182 unowned List<string> branch_names = null ;
178183 try {
@@ -183,7 +188,10 @@ namespace Scratch.Services {
183188 if (! remote_name. has_suffix (" HEAD" ) &&
184189 ! has_local_branch_name (remote_name. substring (ORIGIN_PREFIX . length))) {
185190
186- branch_names. append (branch_ref. get_shorthand ());
191+ branch_names. insert_sorted (
192+ branch_ref. get_shorthand (),
193+ string . collate
194+ );
187195 }
188196
189197 remote_branch_ref_list. append (branch_ref);
You can’t perform that action at this time.
0 commit comments