Skip to content

Commit

Permalink
Fix file tree builder
Browse files Browse the repository at this point in the history
- Don't assume that the last child will be in the root directory.  Call end child until depth is back to 1 before calling build.
  • Loading branch information
allie-wake-up committed Jan 5, 2023
1 parent e5b17a0 commit 317ccb8
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/show/pgtree.rs
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,10 @@ pub fn build_tree(path: &Path, input: Option<String>) -> Result<Tree> {
}
}
}
while depth > 1 {
builder.end_child();
depth -= 1;
}
let mut root = builder.build();
root.sort();
Ok(root)
Expand Down

0 comments on commit 317ccb8

Please sign in to comment.