hgcommands: fix errors on early hook

Summary: This fixes `test-clone-hook.t`, which had some missing output due to adding an early `wait_pager` in D38288111 (b8d14f309e)

Reviewed By: jordanwebster

Differential Revision: D38303439

fbshipit-source-id: b37b16af944290dddb6d8303fee984f2ee27406d
This commit is contained in:
Saul Gutierrez 2022-08-01 08:32:53 -07:00 committed by Facebook GitHub Bot
parent f6a52160c5
commit fd26cdd42a

View File

@ -243,9 +243,6 @@ fn dispatch_command(
};
if !fell_back {
if io.flush().is_err() || io.wait_pager().is_err() {
return 255;
}
if let Some(command) = command {
let mut hooks = config.keys(&["hooks", &format!("pre-{}", command.name())]);
if exit_code > 0 {
@ -261,6 +258,9 @@ fn dispatch_command(
));
}
}
if io.wait_pager().is_err() {
return 255;
}
}
// Clean up progress models.