@@ -13,7 +13,7 @@ pub struct GitConfig<'a> {
1313pub fn output_result ( cmd : & mut Command ) -> Result < String , String > {
1414 let output = match cmd. stderr ( Stdio :: inherit ( ) ) . output ( ) {
1515 Ok ( status) => status,
16- Err ( e) => return Err ( format ! ( "failed to run command: {:?}: {}" , cmd , e ) ) ,
16+ Err ( e) => return Err ( format ! ( "failed to run command: {cmd :?}: {e}" ) ) ,
1717 } ;
1818 if !output. status . success ( ) {
1919 return Err ( format ! (
@@ -62,22 +62,22 @@ pub enum PathFreshness {
6262/// The function behaves differently in CI and outside CI.
6363///
6464/// - Outside CI, we want to find out if `target_paths` were modified in some local commit on
65- /// top of the latest upstream commit that is available in local git history.
66- /// If not, we try to find the most recent upstream commit (which we assume are commits
67- /// made by bors) that modified `target_paths`.
68- /// We don't want to simply take the latest master commit to avoid changing the output of
69- /// this function frequently after rebasing on the latest master branch even if `target_paths`
70- /// were not modified upstream in the meantime. In that case we would be redownloading CI
71- /// artifacts unnecessarily.
65+ /// top of the latest upstream commit that is available in local git history.
66+ /// If not, we try to find the most recent upstream commit (which we assume are commits
67+ /// made by bors) that modified `target_paths`.
68+ /// We don't want to simply take the latest master commit to avoid changing the output of
69+ /// this function frequently after rebasing on the latest master branch even if `target_paths`
70+ /// were not modified upstream in the meantime. In that case we would be redownloading CI
71+ /// artifacts unnecessarily.
7272///
7373/// - In CI, we use a shallow clone of depth 2, i.e., we fetch only a single parent commit
74- /// (which will be the most recent bors merge commit) and do not have access
75- /// to the full git history. Luckily, we only need to distinguish between two situations:
76- /// 1) The current PR made modifications to `target_paths`.
77- /// In that case, a build is typically necessary.
78- /// 2) The current PR did not make modifications to `target_paths`.
79- /// In that case we simply take the latest upstream commit, because on CI there is no need to avoid
80- /// redownloading.
74+ /// (which will be the most recent bors merge commit) and do not have access
75+ /// to the full git history. Luckily, we only need to distinguish between two situations:
76+ /// 1) The current PR made modifications to `target_paths`.
77+ /// In that case, a build is typically necessary.
78+ /// 2) The current PR did not make modifications to `target_paths`.
79+ /// In that case we simply take the latest upstream commit, because on CI there is no need to avoid
80+ /// redownloading.
8181pub fn check_path_modifications (
8282 git_dir : & Path ,
8383 config : & GitConfig < ' _ > ,
@@ -232,7 +232,7 @@ pub fn get_closest_upstream_commit(
232232 "--author-date-order" ,
233233 & format ! ( "--author={}" , config. git_merge_commit_email) ,
234234 "-n1" ,
235- & base,
235+ base,
236236 ] ) ;
237237
238238 let output = output_result ( & mut git) ?. trim ( ) . to_owned ( ) ;
0 commit comments