@@ -10,7 +10,7 @@ fn test_pr_ci_unchanged_anywhere() {
1010 git_test ( |ctx| {
1111 let sha = ctx. create_upstream_merge ( & [ "a" ] ) ;
1212 ctx. create_nonupstream_merge ( & [ "b" ] ) ;
13- let src = ctx. get_source ( & [ "c" ] , CiEnv :: GitHubActions ) ;
13+ let src = ctx. check_modifications ( & [ "c" ] , CiEnv :: GitHubActions ) ;
1414 assert_eq ! ( src, PathFreshness :: LastModifiedUpstream { upstream: sha } ) ;
1515 } ) ;
1616}
@@ -20,7 +20,7 @@ fn test_pr_ci_changed_in_pr() {
2020 git_test ( |ctx| {
2121 let sha = ctx. create_upstream_merge ( & [ "a" ] ) ;
2222 ctx. create_nonupstream_merge ( & [ "b" ] ) ;
23- let src = ctx. get_source ( & [ "b" ] , CiEnv :: GitHubActions ) ;
23+ let src = ctx. check_modifications ( & [ "b" ] , CiEnv :: GitHubActions ) ;
2424 assert_eq ! ( src, PathFreshness :: HasLocalModifications { upstream: sha } ) ;
2525 } ) ;
2626}
@@ -30,7 +30,7 @@ fn test_auto_ci_unchanged_anywhere_select_parent() {
3030 git_test ( |ctx| {
3131 let sha = ctx. create_upstream_merge ( & [ "a" ] ) ;
3232 ctx. create_upstream_merge ( & [ "b" ] ) ;
33- let src = ctx. get_source ( & [ "c" ] , CiEnv :: GitHubActions ) ;
33+ let src = ctx. check_modifications ( & [ "c" ] , CiEnv :: GitHubActions ) ;
3434 assert_eq ! ( src, PathFreshness :: LastModifiedUpstream { upstream: sha } ) ;
3535 } ) ;
3636}
@@ -40,7 +40,7 @@ fn test_auto_ci_changed_in_pr() {
4040 git_test ( |ctx| {
4141 let sha = ctx. create_upstream_merge ( & [ "a" ] ) ;
4242 ctx. create_upstream_merge ( & [ "b" , "c" ] ) ;
43- let src = ctx. get_source ( & [ "c" , "d" ] , CiEnv :: GitHubActions ) ;
43+ let src = ctx. check_modifications ( & [ "c" , "d" ] , CiEnv :: GitHubActions ) ;
4444 assert_eq ! ( src, PathFreshness :: HasLocalModifications { upstream: sha } ) ;
4545 } ) ;
4646}
@@ -53,7 +53,7 @@ fn test_local_uncommitted_modifications() {
5353 ctx. modify ( "a" ) ;
5454
5555 assert_eq ! (
56- ctx. get_source ( & [ "a" , "d" ] , CiEnv :: None ) ,
56+ ctx. check_modifications ( & [ "a" , "d" ] , CiEnv :: None ) ,
5757 PathFreshness :: HasLocalModifications { upstream: sha }
5858 ) ;
5959 } ) ;
@@ -71,7 +71,7 @@ fn test_local_committed_modifications() {
7171 ctx. commit ( ) ;
7272
7373 assert_eq ! (
74- ctx. get_source ( & [ "a" , "d" ] , CiEnv :: None ) ,
74+ ctx. check_modifications ( & [ "a" , "d" ] , CiEnv :: None ) ,
7575 PathFreshness :: HasLocalModifications { upstream: sha }
7676 ) ;
7777 } ) ;
@@ -87,7 +87,7 @@ fn test_local_committed_modifications_subdirectory() {
8787 ctx. commit ( ) ;
8888
8989 assert_eq ! (
90- ctx. get_source ( & [ "a/b" ] , CiEnv :: None ) ,
90+ ctx. check_modifications ( & [ "a/b" ] , CiEnv :: None ) ,
9191 PathFreshness :: HasLocalModifications { upstream: sha }
9292 ) ;
9393 } ) ;
@@ -100,7 +100,7 @@ fn test_local_changes_in_head_upstream() {
100100 // even if it is currently HEAD
101101 let sha = ctx. create_upstream_merge ( & [ "a" ] ) ;
102102 assert_eq ! (
103- ctx. get_source ( & [ "a" , "d" ] , CiEnv :: None ) ,
103+ ctx. check_modifications ( & [ "a" , "d" ] , CiEnv :: None ) ,
104104 PathFreshness :: LastModifiedUpstream { upstream: sha }
105105 ) ;
106106 } ) ;
@@ -117,7 +117,7 @@ fn test_local_changes_in_previous_upstream() {
117117 ctx. modify ( "d" ) ;
118118 ctx. commit ( ) ;
119119 assert_eq ! (
120- ctx. get_source ( & [ "a" ] , CiEnv :: None ) ,
120+ ctx. check_modifications ( & [ "a" ] , CiEnv :: None ) ,
121121 PathFreshness :: LastModifiedUpstream { upstream: sha }
122122 ) ;
123123 } ) ;
@@ -135,7 +135,7 @@ fn test_local_no_upstream_commit_with_changes() {
135135 ctx. modify ( "d" ) ;
136136 ctx. commit ( ) ;
137137 assert_eq ! (
138- ctx. get_source ( & [ "x" ] , CiEnv :: None ) ,
138+ ctx. check_modifications ( & [ "x" ] , CiEnv :: None ) ,
139139 PathFreshness :: LastModifiedUpstream { upstream: sha }
140140 ) ;
141141 } ) ;
@@ -144,7 +144,7 @@ fn test_local_no_upstream_commit_with_changes() {
144144#[ test]
145145fn test_local_no_upstream_commit ( ) {
146146 git_test ( |ctx| {
147- let src = ctx. get_source ( & [ "c" , "d" ] , CiEnv :: None ) ;
147+ let src = ctx. check_modifications ( & [ "c" , "d" ] , CiEnv :: None ) ;
148148 assert_eq ! ( src, PathFreshness :: MissingUpstream ) ;
149149 } ) ;
150150}
@@ -159,15 +159,15 @@ fn test_local_changes_negative_path() {
159159 ctx. commit ( ) ;
160160
161161 assert_eq ! (
162- ctx. get_source ( & [ ":!b" , ":!d" ] , CiEnv :: None ) ,
162+ ctx. check_modifications ( & [ ":!b" , ":!d" ] , CiEnv :: None ) ,
163163 PathFreshness :: LastModifiedUpstream { upstream: upstream. clone( ) }
164164 ) ;
165165 assert_eq ! (
166- ctx. get_source ( & [ ":!c" ] , CiEnv :: None ) ,
166+ ctx. check_modifications ( & [ ":!c" ] , CiEnv :: None ) ,
167167 PathFreshness :: HasLocalModifications { upstream: upstream. clone( ) }
168168 ) ;
169169 assert_eq ! (
170- ctx. get_source ( & [ ":!d" , ":!x" ] , CiEnv :: None ) ,
170+ ctx. check_modifications ( & [ ":!d" , ":!x" ] , CiEnv :: None ) ,
171171 PathFreshness :: HasLocalModifications { upstream }
172172 ) ;
173173 } ) ;
@@ -198,7 +198,7 @@ impl GitCtx {
198198 ctx
199199 }
200200
201- fn get_source ( & self , target_paths : & [ & str ] , ci_env : CiEnv ) -> PathFreshness {
201+ fn check_modifications ( & self , target_paths : & [ & str ] , ci_env : CiEnv ) -> PathFreshness {
202202 check_path_modifications ( Some ( self . dir . path ( ) ) , & self . git_config ( ) , target_paths, ci_env)
203203 . unwrap ( )
204204 }
0 commit comments