File tree Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Original file line number Diff line number Diff line change @@ -61,7 +61,8 @@ impl FileFilter {
61
61
for line in read_buf. split ( '\n' ) {
62
62
if line. trim_start ( ) . starts_with ( "path" ) {
63
63
assert ! ( line. find( '=' ) . unwrap( ) > 0 ) ;
64
- let submodule = String :: from ( "./" ) + line. split ( '=' ) . last ( ) . unwrap ( ) . trim ( ) ;
64
+ let submodule =
65
+ String :: from ( "./" ) + line. split ( '=' ) . next_back ( ) . unwrap ( ) . trim ( ) ;
65
66
log:: debug!( "Found submodule: {submodule}" ) ;
66
67
let mut is_ignored = true ;
67
68
for pat in & self . not_ignored {
@@ -159,7 +160,7 @@ impl FileFilter {
159
160
let mut is_hidden = false ;
160
161
let parent = path
161
162
. components ( )
162
- . last ( )
163
+ . next_back ( )
163
164
. ok_or ( anyhow ! ( "parent directory not known for {path:?}" ) ) ?;
164
165
if parent. as_os_str ( ) . to_str ( ) . unwrap ( ) . starts_with ( '.' ) {
165
166
is_hidden = true ;
You can’t perform that action at this time.
0 commit comments