@@ -24,6 +24,7 @@ pub enum Error {
24
24
} ,
25
25
}
26
26
27
+ /// Lifecycle
27
28
impl State {
28
29
/// Obtain a process as defined in `driver` suitable for a given `operation. `rela_path` may be used to substitute the current
29
30
/// file for use in the invoked `SingleFile` process.
@@ -40,7 +41,7 @@ impl State {
40
41
let client = match self . running . remove ( process) {
41
42
Some ( c) => c,
42
43
None => {
43
- let ( child, cmd) = spawn_driver ( process. clone ( ) ) ?;
44
+ let ( child, cmd) = spawn_driver ( process. clone ( ) , & self . context ) ?;
44
45
process:: Client :: handshake ( child, "git-filter" , & [ 2 ] , & [ "clean" , "smudge" , "delay" ] ) . map_err (
45
46
|err| Error :: ProcessHandshake {
46
47
source : err,
@@ -79,20 +80,25 @@ impl State {
79
80
None => return Ok ( None ) ,
80
81
} ;
81
82
82
- let ( child, command) = spawn_driver ( cmd) ?;
83
+ let ( child, command) = spawn_driver ( cmd, & self . context ) ?;
83
84
Ok ( Some ( Process :: SingleFile { child, command } ) )
84
85
}
85
86
}
86
87
}
87
88
}
88
89
89
- fn spawn_driver ( cmd : BString ) -> Result < ( std:: process:: Child , std:: process:: Command ) , Error > {
90
+ fn spawn_driver (
91
+ cmd : BString ,
92
+ context : & gix_command:: Context ,
93
+ ) -> Result < ( std:: process:: Child , std:: process:: Command ) , Error > {
90
94
let mut cmd: std:: process:: Command = gix_command:: prepare ( gix_path:: from_bstr ( cmd) . into_owned ( ) )
91
95
. with_shell ( )
96
+ . with_context ( context. clone ( ) )
92
97
. stdin ( Stdio :: piped ( ) )
93
98
. stdout ( Stdio :: piped ( ) )
94
99
. stderr ( Stdio :: inherit ( ) )
95
100
. into ( ) ;
101
+ gix_trace:: debug!( cmd = ?cmd, "launching filter driver" ) ;
96
102
let child = match cmd. spawn ( ) {
97
103
Ok ( child) => child,
98
104
Err ( err) => {
0 commit comments