Skip to content

Commit

Permalink
Restricting error to just missing git revparse
Browse files Browse the repository at this point in the history
  • Loading branch information
NicholasLYang committed Aug 1, 2024
1 parent 13cc2a5 commit 208774c
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions crates/turborepo-scm/src/git.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand Down

0 comments on commit 208774c

Please sign in to comment.