File tree Expand file tree Collapse file tree 3 files changed +8
-4
lines changed Expand file tree Collapse file tree 3 files changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -16,6 +16,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
16
16
- openssl vendoring broken on macos ([ #772 ] ( https://github.com/extrawurst/gitui/issues/772 ) )
17
17
- amend and other commands not shown in help ([ #778 ] ( https://github.com/extrawurst/gitui/issues/778 ) )
18
18
- focus locked on commit msg details in narrow term sizes ([ #780 ] ( https://github.com/extrawurst/gitui/issues/780 ) )
19
+ - non-utf8 file/path names broke filetree ([ #802 ] ( https://github.com/extrawurst/gitui/issues/802 ) )
19
20
20
21
## [ 0.16.1] - 2021-06-06
21
22
Original file line number Diff line number Diff line change 1
- use super :: { utils :: bytes2string , CommitId } ;
1
+ use super :: CommitId ;
2
2
use crate :: {
3
3
error:: { Error , Result } ,
4
4
sync:: utils:: repo,
@@ -101,7 +101,8 @@ fn tree_recurse(
101
101
out. reserve ( tree. len ( ) ) ;
102
102
103
103
for e in tree {
104
- let path = path. join ( bytes2string ( e. name_bytes ( ) ) ?) ;
104
+ let p = String :: from_utf8_lossy ( e. name_bytes ( ) ) ;
105
+ let path = path. join ( p. to_string ( ) ) ;
105
106
match e. kind ( ) {
106
107
Some ( git2:: ObjectType :: Blob ) => {
107
108
let id = e. id ( ) ;
Original file line number Diff line number Diff line change @@ -55,8 +55,10 @@ impl FileTree {
55
55
56
56
///
57
57
pub fn collapse_but_root ( & mut self ) {
58
- self . items . collapse ( 0 , true ) ;
59
- self . items . expand ( 0 , false ) ;
58
+ if !self . is_empty ( ) {
59
+ self . items . collapse ( 0 , true ) ;
60
+ self . items . expand ( 0 , false ) ;
61
+ }
60
62
}
61
63
62
64
/// iterates visible elements starting from `start_index_visual`
You can’t perform that action at this time.
0 commit comments