@@ -108,23 +108,6 @@ protected override void OnGUI()
108108
109109 base . OnGUI ( ) ;
110110 }
111- List < TreeViewItem > GenerateItems ( IEnumerable < Reference [ ] > branchesPerRepo )
112- {
113- var modules = PackageShortcuts . GetSelectedGitModules ( ) ;
114- IEnumerable < Reference > references = branchesPerRepo . Count ( ) == 1 ? branchesPerRepo . First ( )
115- : showAllBranches ? branchesPerRepo . SelectMany ( x => x ) . Distinct ( referenceComparer )
116- : branchesPerRepo . Skip ( 1 ) . Aggregate ( branchesPerRepo . First ( ) . AsEnumerable ( ) , ( result , nextArray ) => result . Intersect ( nextArray , referenceComparer ) ) ;
117- var items = new List < TreeViewItem > ( ) ;
118- items . Add ( new TreeViewItem ( 0 , 0 , "Branches" ) { icon = EditorGUIUtility . IconContent ( "UnityEditor.VersionControl" ) . image as Texture2D } ) ;
119- BranchesToItems ( modules , references , x => x is LocalBranch , 1 , items ) ;
120- items . Add ( new TreeViewItem ( 1 , 0 , "Remotes" ) { icon = EditorGUIUtility . IconContent ( "CloudConnect@2x" ) . image as Texture2D } ) ;
121- BranchesToItems ( modules , references , x => x is RemoteBranch , 1 , items ) ;
122- items . Add ( new TreeViewItem ( 2 , 0 , "Tags" ) { icon = EditorGUIUtility . IconContent ( "FilterByLabel@2x" ) . image as Texture2D } ) ;
123- BranchesToItems ( modules , references , x => x is Tag , 1 , items ) ;
124- items . Add ( new TreeViewItem ( 3 , 0 , "Stashes" ) { icon = EditorGUIUtility . IconContent ( "Package Manager@2x" ) . image as Texture2D } ) ;
125- BranchesToItems ( modules , references , x => x is Stash , 1 , items ) ;
126- return items ;
127- }
128111 static async void CreateOrRenameBranch ( string oldName = null )
129112 {
130113 string newName = oldName ;
@@ -219,6 +202,23 @@ void ShowContextMenu(IEnumerable<Module> modules, Reference selectedReference)
219202 menu . AddItem ( new GUIContent ( $ "New Tag") , false , ( ) => GUIShortcuts . MakeTag ( ) ) ;
220203 menu . ShowAsContext ( ) ;
221204 }
205+ List < TreeViewItem > GenerateItems ( IEnumerable < Reference [ ] > branchesPerRepo )
206+ {
207+ var modules = PackageShortcuts . GetSelectedGitModules ( ) ;
208+ IEnumerable < Reference > references = branchesPerRepo . Count ( ) == 1 ? branchesPerRepo . First ( )
209+ : showAllBranches ? branchesPerRepo . SelectMany ( x => x ) . Distinct ( referenceComparer )
210+ : branchesPerRepo . Skip ( 1 ) . Aggregate ( branchesPerRepo . First ( ) . AsEnumerable ( ) , ( result , nextArray ) => result . Intersect ( nextArray , referenceComparer ) ) ;
211+ var items = new List < TreeViewItem > ( ) ;
212+ items . Add ( new TreeViewItem ( 0 , 0 , "Branches" ) { icon = EditorGUIUtility . IconContent ( "UnityEditor.VersionControl" ) . image as Texture2D } ) ;
213+ BranchesToItems ( modules , references , x => x is LocalBranch , 1 , items ) ;
214+ items . Add ( new TreeViewItem ( 1 , 0 , "Remotes" ) { icon = EditorGUIUtility . IconContent ( "CloudConnect@2x" ) . image as Texture2D } ) ;
215+ BranchesToItems ( modules , references , x => x is RemoteBranch , 1 , items ) ;
216+ items . Add ( new TreeViewItem ( 2 , 0 , "Tags" ) { icon = EditorGUIUtility . IconContent ( "FilterByLabel@2x" ) . image as Texture2D } ) ;
217+ BranchesToItems ( modules , references , x => x is Tag , 1 , items ) ;
218+ items . Add ( new TreeViewItem ( 3 , 0 , "Stashes" ) { icon = EditorGUIUtility . IconContent ( "Package Manager@2x" ) . image as Texture2D } ) ;
219+ BranchesToItems ( modules , references , x => x is Stash , 1 , items ) ;
220+ return items ;
221+ }
222222 List < TreeViewItem > BranchesToItems ( IEnumerable < Module > modules , IEnumerable < Reference > branches , Func < Reference , bool > filter , int rootDepth , List < TreeViewItem > items )
223223 {
224224 string currentPath = "" ;
0 commit comments