File tree Expand file tree Collapse file tree 1 file changed +4
-1
lines changed Expand file tree Collapse file tree 1 file changed +4
-1
lines changed Original file line number Diff line number Diff line change @@ -40,6 +40,7 @@ enum CommandState<'a> {
4040 } ,
4141}
4242
43+ #[ must_use]
4344pub struct DeferredCommand < ' a > {
4445 state : CommandState < ' a > ,
4546}
@@ -122,11 +123,11 @@ impl ExecutionContext {
122123 stdout : OutputMode ,
123124 stderr : OutputMode ,
124125 ) -> DeferredCommand < ' a > {
125- command. mark_as_executed ( ) ;
126126 let cache_key = command. cache_key ( ) ;
127127
128128 if let Some ( cached_output) = cache_key. as_ref ( ) . and_then ( |key| self . command_cache . get ( key) )
129129 {
130+ command. mark_as_executed ( ) ;
130131 self . verbose ( || println ! ( "Cache hit: {command:?}" ) ) ;
131132 return DeferredCommand { state : CommandState :: Cached ( cached_output) } ;
132133 }
@@ -244,6 +245,8 @@ impl<'a> DeferredCommand<'a> {
244245 executed_at : & ' a std:: panic:: Location < ' a > ,
245246 exec_ctx : & ExecutionContext ,
246247 ) -> CommandOutput {
248+ command. mark_as_executed ( ) ;
249+
247250 let process = match process. take ( ) {
248251 Some ( p) => p,
249252 None => return CommandOutput :: default ( ) ,
You can’t perform that action at this time.
0 commit comments