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

Commit 88edbb5

Browse files
Removing PathIgnoreRoot as it should not be needed
1 parent a76dbc0 commit 88edbb5

File tree

1 file changed

+4
-15
lines changed

1 file changed

+4
-15
lines changed

src/GitHub.Api/UI/TreeLoader.cs

Lines changed: 4 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,11 @@ public interface ITree
1313
bool DisplayRootNode { get; }
1414
bool IsCheckable { get; }
1515
string PathSeparator { get; }
16-
string PathIgnoreRoot { get; }
1716
}
1817

1918
public static class TreeLoader
2019
{
21-
public static void Load(ITree tree, IEnumerable<ITreeData> data)
20+
public static void Load(ITree tree, IEnumerable<ITreeData> treeDatas)
2221
{
2322
var collapsedFolders = tree.GetCollapsedFolders();
2423

@@ -33,19 +32,9 @@ public static void Load(ITree tree, IEnumerable<ITreeData> data)
3332

3433
var folders = new HashSet<string>();
3534

36-
foreach (var d in data)
35+
foreach (var treeData in treeDatas)
3736
{
38-
var path = d.Path;
39-
if (tree.PathIgnoreRoot != null)
40-
{
41-
var indexOf = path.IndexOf(tree.PathIgnoreRoot);
42-
if (indexOf != -1)
43-
{
44-
path = path.Substring(indexOf + tree.PathIgnoreRoot.Length);
45-
}
46-
}
47-
48-
var parts = path.Split(new[] { tree.PathSeparator }, StringSplitOptions.None);
37+
var parts = treeData.Path.Split(new[] { tree.PathSeparator }, StringSplitOptions.None);
4938
for (int i = 0; i < parts.Length; i++)
5039
{
5140
var label = parts[i];
@@ -86,7 +75,7 @@ public static void Load(ITree tree, IEnumerable<ITreeData> data)
8675

8776
}
8877

89-
tree.AddNode(fullPath: d.FullPath, path: nodePath, label: label, level: i + displayRootLevel, isFolder: isFolder, isActive: d.IsActive, isHidden: nodeIsHidden, isCollapsed: nodeIsCollapsed);
78+
tree.AddNode(fullPath: treeData.FullPath, path: nodePath, label: label, level: i + displayRootLevel, isFolder: isFolder, isActive: treeData.IsActive, isHidden: nodeIsHidden, isCollapsed: nodeIsCollapsed);
9079
}
9180
}
9281
}

0 commit comments

Comments
 (0)