This repository was archived by the owner on Dec 5, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 4 files changed +30
-9
lines changed
UnityExtension/Assets/Editor/GitHub.Unity/UI Expand file tree Collapse file tree 4 files changed +30
-9
lines changed Original file line number Diff line number Diff line change 2
2
3
3
namespace GitHub . Unity
4
4
{
5
- public interface ITreeData
6
- {
7
- string Name { get ; }
8
- bool IsActive { get ; }
9
- }
10
-
11
5
[ Serializable ]
12
- public struct GitBranch : ITreeData
6
+ public struct GitBranch
13
7
{
14
8
public static GitBranch Default = new GitBranch ( ) ;
15
9
Original file line number Diff line number Diff line change
1
+ using System ;
2
+
3
+ namespace GitHub . Unity
4
+ {
5
+ public interface ITreeData
6
+ {
7
+ string Name { get ; }
8
+ bool IsActive { get ; }
9
+ }
10
+
11
+ [ Serializable ]
12
+ public struct GitBranchTreeData : ITreeData
13
+ {
14
+ public static GitBranchTreeData Default = new GitBranchTreeData ( Unity . GitBranch . Default ) ;
15
+
16
+ public GitBranch GitBranch ;
17
+
18
+ public GitBranchTreeData ( GitBranch gitBranch )
19
+ {
20
+ GitBranch = gitBranch ;
21
+ }
22
+
23
+ public string Name => GitBranch . Name ;
24
+ public bool IsActive => GitBranch . IsActive ;
25
+ }
26
+ }
Original file line number Diff line number Diff line change 106
106
<Compile Include =" Git\ManagedCacheExtensions.cs" />
107
107
<Compile Include =" Git\Tasks\GitLfsVersionTask.cs" />
108
108
<Compile Include =" Git\Tasks\GitVersionTask.cs" />
109
+ <Compile Include =" Git\TreeData.cs" />
109
110
<Compile Include =" Git\ValidateGitInstallResult.cs" />
110
111
<Compile Include =" Helpers\AssemblyResources.cs" />
111
112
<Compile Include =" Authentication\IKeychain.cs" />
Original file line number Diff line number Diff line change @@ -151,8 +151,8 @@ private void BuildTree()
151
151
localBranches . Sort ( CompareBranches ) ;
152
152
remoteBranches . Sort ( CompareBranches ) ;
153
153
154
- treeLocals . Load ( localBranches . Cast < ITreeData > ( ) , LocalTitle ) ;
155
- treeRemotes . Load ( remoteBranches . Cast < ITreeData > ( ) , RemoteTitle ) ;
154
+ treeLocals . Load ( localBranches . Select ( branch => ( ITreeData ) new GitBranchTreeData ( branch ) ) , LocalTitle ) ;
155
+ treeRemotes . Load ( remoteBranches . Select ( branch => ( ITreeData ) new GitBranchTreeData ( branch ) ) , RemoteTitle ) ;
156
156
Redraw ( ) ;
157
157
}
158
158
You can’t perform that action at this time.
0 commit comments