Fix file browser for directories two levels deep
TreeWalk was only entering exact-match subtrees, missing intermediate directories. Now enters all subtrees that are prefix of the target path. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
@@ -464,13 +464,15 @@ public class GitService
|
||||
if (dirPath != null && !dirPath.isEmpty())
|
||||
{
|
||||
tw.setFilter(PathFilter.create(dirPath));
|
||||
// Walk into the directory
|
||||
// Walk into the directory, entering intermediate subtrees as needed
|
||||
while (tw.next())
|
||||
{
|
||||
if (tw.isSubtree() && tw.getPathString().equals(dirPath))
|
||||
if (tw.isSubtree())
|
||||
{
|
||||
String path = tw.getPathString();
|
||||
tw.enterSubtree();
|
||||
break;
|
||||
if (path.equals(dirPath))
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user