File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -846,14 +846,12 @@ impl GitRepository for RealGitRepository {
846846 . stdin ( Stdio :: piped ( ) )
847847 . stdout ( Stdio :: piped ( ) )
848848 . spawn ( ) ?;
849- child
850- . stdin
851- . take ( )
852- . unwrap ( )
853- . write_all ( content. as_bytes ( ) )
854- . await ?;
849+ let mut stdin = child. stdin . take ( ) . unwrap ( ) ;
850+ stdin. write_all ( content. as_bytes ( ) ) . await ?;
851+ stdin. flush ( ) . await ?;
852+ drop ( stdin) ;
855853 let output = child. output ( ) . await ?. stdout ;
856- let sha = String :: from_utf8 ( output) ?;
854+ let sha = str :: from_utf8 ( & output) ?. trim ( ) ;
857855
858856 log:: debug!( "indexing SHA: {sha}, path {path:?}" ) ;
859857
@@ -871,6 +869,7 @@ impl GitRepository for RealGitRepository {
871869 String :: from_utf8_lossy( & output. stderr)
872870 ) ;
873871 } else {
872+ log:: debug!( "removing path {path:?} from the index" ) ;
874873 let output = new_smol_command ( & git_binary_path)
875874 . current_dir ( & working_directory)
876875 . envs ( env. iter ( ) )
@@ -921,6 +920,7 @@ impl GitRepository for RealGitRepository {
921920 for rev in & revs {
922921 write ! ( & mut stdin, "{rev}\n " ) ?;
923922 }
923+ stdin. flush ( ) ?;
924924 drop ( stdin) ;
925925
926926 let output = process. wait_with_output ( ) ?;
You can’t perform that action at this time.
0 commit comments