From 208774c7f7d999860668dcececd89d7e172ce20d Mon Sep 17 00:00:00 2001 From: nicholaslyang Date: Thu, 1 Aug 2024 15:35:23 -0400 Subject: [PATCH] Restricting error to just missing git revparse --- crates/turborepo-scm/src/git.rs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/crates/turborepo-scm/src/git.rs b/crates/turborepo-scm/src/git.rs index c3c133d52b9e87..8a2fdc3663214f 100644 --- a/crates/turborepo-scm/src/git.rs +++ b/crates/turborepo-scm/src/git.rs @@ -39,10 +39,13 @@ impl SCM { Self::Git(git) => { match git.changed_files(turbo_root, from_commit, to_commit, include_uncommitted) { Ok(files) => Ok(ChangedFiles::Some(files)), - Err(e) if allow_unknown_objects => { + Err(ref error @ Error::Git(ref message, _)) + if allow_unknown_objects + && message.contains("unknown revision or path") => + { warn!( "unable to detect git range, assuming all files have changed: {}", - e + error ); Ok(ChangedFiles::All) }