Skip to content
This repository was archived by the owner on Dec 5, 2024. It is now read-only.

Commit fa1ffde

Browse files
Merge pull request #471 from github-for-unity/enhancements/changes-tree-view-rollup
Changes TreeView Rollup
2 parents 5026ba0 + 3fee519 commit fa1ffde

File tree

10 files changed

+1158
-376
lines changed

10 files changed

+1158
-376
lines changed

src/GitHub.Api/Git/GitBranch.cs

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,8 @@
22

33
namespace GitHub.Unity
44
{
5-
public interface ITreeData
6-
{
7-
string Name { get; }
8-
bool IsActive { get; }
9-
}
10-
115
[Serializable]
12-
public struct GitBranch : ITreeData
6+
public struct GitBranch
137
{
148
public static GitBranch Default = new GitBranch();
159

src/GitHub.Api/Git/TreeData.cs

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
using System;
2+
3+
namespace GitHub.Unity
4+
{
5+
public interface ITreeData
6+
{
7+
string Path { 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 Path => GitBranch.Name;
24+
public bool IsActive => GitBranch.IsActive;
25+
}
26+
27+
[Serializable]
28+
public struct GitStatusEntryTreeData : ITreeData
29+
{
30+
public static GitStatusEntryTreeData Default = new GitStatusEntryTreeData(GitStatusEntry.Default);
31+
32+
public GitStatusEntry gitStatusEntry;
33+
34+
public GitStatusEntryTreeData(GitStatusEntry gitStatusEntry)
35+
{
36+
this.gitStatusEntry = gitStatusEntry;
37+
}
38+
39+
public string Path => gitStatusEntry.Path;
40+
public string ProjectPath => gitStatusEntry.ProjectPath;
41+
public bool IsActive => false;
42+
public GitStatusEntry GitStatusEntry => gitStatusEntry;
43+
44+
public GitFileStatus FileStatus => gitStatusEntry.Status;
45+
}
46+
}

src/GitHub.Api/GitHub.Api.csproj

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,7 @@
107107
<Compile Include="Git\Tasks\GitAheadBehindStatusTask.cs" />
108108
<Compile Include="Git\Tasks\GitLfsVersionTask.cs" />
109109
<Compile Include="Git\Tasks\GitVersionTask.cs" />
110+
<Compile Include="Git\TreeData.cs" />
110111
<Compile Include="Git\ValidateGitInstallResult.cs" />
111112
<Compile Include="Helpers\AssemblyResources.cs" />
112113
<Compile Include="Authentication\IKeychain.cs" />
@@ -237,6 +238,7 @@
237238
<Compile Include="Git\GitCredentialManager.cs" />
238239
<Compile Include="UI\FileTreeNode.cs" />
239240
<Compile Include="UI\GitCommitTarget.cs" />
241+
<Compile Include="UI\TreeBase.cs" />
240242
<Compile Include="UI\TreeBuilder.cs" />
241243
</ItemGroup>
242244
<Choose>
@@ -294,6 +296,7 @@
294296
<ItemGroup>
295297
<None Include="packages.config" />
296298
</ItemGroup>
299+
<ItemGroup />
297300
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
298301
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
299302
Other similar extension points exist, see Microsoft.Common.targets.

0 commit comments

Comments
 (0)