huskies: merge 1151 bug install_pre_commit_hook blocks the tokio executor — sync std::process::Command::output() in an async path stalls worktree-create-sub
This commit is contained in:
@@ -129,7 +129,13 @@ pub(crate) async fn on_coding_transition(project_root: &Path, port: u16, story_i
|
||||
"[worktree-create-sub] Worktree ready for '{story_id}' at {}",
|
||||
info.path.display()
|
||||
);
|
||||
if let Err(e) = crate::worktree::install_pre_commit_hook(&info.path) {
|
||||
let hook_path = info.path.clone();
|
||||
let hook_result = tokio::task::spawn_blocking(move || {
|
||||
crate::worktree::install_pre_commit_hook(&hook_path)
|
||||
})
|
||||
.await
|
||||
.unwrap_or_else(|e| Err(format!("spawn_blocking panicked: {e}")));
|
||||
if let Err(e) = hook_result {
|
||||
slog_warn!(
|
||||
"[worktree-create-sub] Pre-commit hook install failed for '{story_id}': {e}"
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user