diff options
Diffstat (limited to 'src/build_helper')
| -rw-r--r-- | src/build_helper/src/git.rs | 5 | ||||
| -rw-r--r-- | src/build_helper/src/git/tests.rs | 5 |
2 files changed, 8 insertions, 2 deletions
diff --git a/src/build_helper/src/git.rs b/src/build_helper/src/git.rs index e1e7319b9aa..fce3a8eca9b 100644 --- a/src/build_helper/src/git.rs +++ b/src/build_helper/src/git.rs @@ -261,6 +261,11 @@ pub fn check_path_modifications( upstream_sha }; + // For local environments, we want to find out if something has changed + // from the latest upstream commit. + // However, that should be equivalent to checking if something has changed + // from the latest upstream commit *that modified `target_paths`*, and + // with this approach we do not need to invoke git an additional time. if has_changed_since(git_dir, &upstream_sha, target_paths) { Ok(PathFreshness::HasLocalModifications { upstream: upstream_sha }) } else { diff --git a/src/build_helper/src/git/tests.rs b/src/build_helper/src/git/tests.rs index cdf50e14218..cc502f08387 100644 --- a/src/build_helper/src/git/tests.rs +++ b/src/build_helper/src/git/tests.rs @@ -1,9 +1,10 @@ -use crate::ci::CiEnv; -use crate::git::{GitConfig, PathFreshness, check_path_modifications}; use std::ffi::OsStr; use std::fs::OpenOptions; use std::process::Command; +use crate::ci::CiEnv; +use crate::git::{GitConfig, PathFreshness, check_path_modifications}; + #[test] fn test_pr_ci_unchanged_anywhere() { git_test(|ctx| { |
