File tree Expand file tree Collapse file tree 1 file changed +12
-0
lines changed
gix-transport/src/client/blocking_io Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -126,6 +126,18 @@ impl client::TransportWithoutIO for SpawnProcessOnDemand {
126
126
}
127
127
}
128
128
129
+ impl Drop for SpawnProcessOnDemand {
130
+ fn drop ( & mut self ) {
131
+ if let Some ( mut child) = self . child . take ( ) {
132
+ // The child process (e.g. `ssh`) may still be running at this point, so kill it before joining/waiting.
133
+ // In the happy-path case, it should have already exited gracefully, but in error cases or if the user
134
+ // interrupted the operation, it will likely still be running.
135
+ child. kill ( ) . ok ( ) ;
136
+ child. wait ( ) . ok ( ) ;
137
+ }
138
+ }
139
+ }
140
+
129
141
struct ReadStdoutFailOnError {
130
142
recv : std:: sync:: mpsc:: Receiver < std:: io:: Error > ,
131
143
read : std:: process:: ChildStdout ,
You can’t perform that action at this time.
0 commit comments