@@ -7,6 +7,7 @@ use std::sync::LazyLock;
77
88use anyhow:: Result ;
99use path_clean:: PathClean ;
10+ use prek_consts:: env_vars:: EnvVars ;
1011use rustc_hash:: FxHashSet ;
1112use tokio:: io:: { AsyncReadExt , AsyncWriteExt } ;
1213use tracing:: { debug, instrument, warn} ;
@@ -367,6 +368,9 @@ async fn shallow_clone(rev: &str, path: &Path) -> Result<(), Error> {
367368 . arg ( "origin" )
368369 . arg ( rev)
369370 . arg ( "--depth=1" )
371+ // Disable interactive prompts in the terminal, as they'll be erased by the progress bar
372+ // animation and the process will "hang".
373+ . env ( EnvVars :: GIT_TERMINAL_PROMPT , "0" )
370374 . remove_git_env ( )
371375 . check ( true )
372376 . output ( )
@@ -390,6 +394,7 @@ async fn shallow_clone(rev: &str, path: &Path) -> Result<(), Error> {
390394 . arg ( "--init" )
391395 . arg ( "--recursive" )
392396 . arg ( "--depth=1" )
397+ . env ( EnvVars :: GIT_TERMINAL_PROMPT , "0" )
393398 . remove_git_env ( )
394399 . check ( true )
395400 . output ( )
@@ -404,6 +409,7 @@ async fn full_clone(rev: &str, path: &Path) -> Result<(), Error> {
404409 . arg ( "fetch" )
405410 . arg ( "origin" )
406411 . arg ( "--tags" )
412+ . env ( EnvVars :: GIT_TERMINAL_PROMPT , "0" )
407413 . remove_git_env ( )
408414 . check ( true )
409415 . output ( )
@@ -424,6 +430,7 @@ async fn full_clone(rev: &str, path: &Path) -> Result<(), Error> {
424430 . arg ( "update" )
425431 . arg ( "--init" )
426432 . arg ( "--recursive" )
433+ . env ( EnvVars :: GIT_TERMINAL_PROMPT , "0" )
427434 . remove_git_env ( )
428435 . check ( true )
429436 . output ( )
0 commit comments