Skip to content

Commit f852d75

Browse files
chore(scm): gate manual file hash behind git2 (#10088)
### Description We're getting some dead code warning when building `@turbo/repository`: ``` warning: function `git_like_hash_file` is never used Warning: --> crates/turborepo-scm/src/manual.rs:12:4 | 12 | fn git_like_hash_file(path: &AbsoluteSystemPath) -> Result<String, Error> { | ^^^^^^^^^^^^^^^^^^ | = note: `#[warn(dead_code)]` on by default warning: function `to_glob` is never used Warning: --> crates/turborepo-scm/src/manual.rs:31:4 | 31 | fn to_glob(input: &str) -> Result<Glob, Error> { | ^^^^^^^ warning: function `hash_files` is never used Warning: --> crates/turborepo-scm/src/manual.rs:38:15 | 38 | pub(crate) fn hash_files( | ^^^^^^^^^^ warning: function `get_package_file_hashes_without_git` is never used Warning: --> crates/turborepo-scm/src/manual.rs:59:15 | 59 | pub(crate) fn get_package_file_hashes_without_git<S: AsRef<str>>( ``` Gate this module behind `git2` to silence it. ### Testing Instructions `cargo build -p turborepo-napi` should not produce any errors
1 parent bc2ba73 commit f852d75

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

crates/turborepo-scm/src/manual.rs

+3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
// This module doesn't require git2, but it is only used by modules that require
2+
// git2.
3+
#![cfg(feature = "git2")]
14
use std::io::{ErrorKind, Read};
25

36
use globwalk::fix_glob_pattern;

0 commit comments

Comments
 (0)