Commit b8b44b6
fix: api.tree.change_root_to_node on a file now changes directory to parent as per documentation (#3228)
fix: wrong behavior for api.tree.change_root_to_node
As described in the documentation, `api.tree.change_root_to_node` should
set the tree root to the parent directory when the target node is a file.
Currently, calling this function on a file node does nothing.
This commit adds logic to handle cases where the input node is a `FileNode`
in the `change_root_to_node` function.
Co-authored-by: Alexander Courtis <alex@courtis.org>1 parent b63d367 commit b8b44b6
1 file changed
+12
-5
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
| 12 | + | |
12 | 13 | | |
13 | 14 | | |
14 | 15 | | |
| |||
160 | 161 | | |
161 | 162 | | |
162 | 163 | | |
163 | | - | |
164 | | - | |
165 | | - | |
166 | | - | |
167 | | - | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
168 | 175 | | |
169 | 176 | | |
170 | 177 | | |
| |||
0 commit comments