pub fn changed_files(
        &self,
        turbo_root: &AbsoluteSystemPath,
        from_commit: Option<&str>,
        to_commit: Option<&str>,
        include_uncommitted: bool,
        allow_unknown_objects: bool,
        merge_base: bool,
    ) -> Result<Result<HashSet<AnchoredSystemPathBuf>, InvalidRange>, Error> {
        fn unable_to_detect_range(
            error: impl std::error::Error,
            from_ref: Option<String>,
            to_ref: Option<String>,
        ) -> Result<Result<HashSet<AnchoredSystemPathBuf>, InvalidRange>, Error> {
            warn!(
                "unable to detect git range, assuming all files have changed: {}",
                error
            );
            Ok(Err(InvalidRange { from_ref, to_ref }))
        }
        match self {
            Self::Git(git) => {
                match git.changed_files(
                    turbo_root,
                    from_commit,
                    to_commit,
                    include_uncommitted,
                    merge_base,
                ) {
                    Ok(files) => Ok(Ok(files)),
                    Err(ref error @ Error::Git(ref message, _))
                        if allow_unknown_objects
                            && (message.contains("no merge base")
                                || message.contains("bad object")) =>
                    {
                        unable_to_detect_range(
                            error,
                            from_commit.map(|c| c.to_string()),
                            to_commit.map(|c| c.to_string()),
                        )
                    }
                    Err(Error::UnableToResolveRef) => unable_to_detect_range(
                        Error::UnableToResolveRef,
                        from_commit.map(|c| c.to_string()),
                        to_commit.map(|c| c.to_string()),
                    ),
                    Err(e) => Err(e),
                }
            }
            Self::Manual => Err(Error::GitRequired(turbo_root.to_owned())),
        }
    }
get the actual changed files between two git refs
crates/turborepo-scm/src/git.rs