@@ -13,7 +13,7 @@ pub struct GitConfig<'a> {
13
13
pub fn output_result ( cmd : & mut Command ) -> Result < String , String > {
14
14
let output = match cmd. stderr ( Stdio :: inherit ( ) ) . output ( ) {
15
15
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}" ) ) ,
17
17
} ;
18
18
if !output. status . success ( ) {
19
19
return Err ( format ! (
@@ -62,22 +62,22 @@ pub enum PathFreshness {
62
62
/// The function behaves differently in CI and outside CI.
63
63
///
64
64
/// - 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.
72
72
///
73
73
/// - 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.
81
81
pub fn check_path_modifications (
82
82
git_dir : & Path ,
83
83
config : & GitConfig < ' _ > ,
@@ -232,7 +232,7 @@ pub fn get_closest_upstream_commit(
232
232
"--author-date-order" ,
233
233
& format ! ( "--author={}" , config. git_merge_commit_email) ,
234
234
"-n1" ,
235
- & base,
235
+ base,
236
236
] ) ;
237
237
238
238
let output = output_result ( & mut git) ?. trim ( ) . to_owned ( ) ;
0 commit comments