File tree Expand file tree Collapse file tree 3 files changed +5
-4
lines changed Expand file tree Collapse file tree 3 files changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -113,7 +113,7 @@ pub fn execute(matches: &ArgMatches) -> Result<()> {
113113 . get_one ( "head_sha" )
114114 . map ( String :: as_str)
115115 . map ( Cow :: Borrowed )
116- . or_else ( || vcs:: find_head ( ) . ok ( ) . map ( Cow :: Owned ) ) ;
116+ . or_else ( || vcs:: find_head_sha ( ) . ok ( ) . map ( Cow :: Owned ) ) ;
117117
118118 let cached_remote = config. get_cached_vcs_remote ( ) ;
119119 // Try to open the git repository and find the remote, but handle errors gracefully.
Original file line number Diff line number Diff line change @@ -158,7 +158,8 @@ pub fn detect_release_name() -> Result<String> {
158158 }
159159 }
160160
161- match vcs:: find_head ( ) {
161+ // finally try the git sha
162+ match vcs:: find_head_sha ( ) {
162163 Ok ( head) => Ok ( head) ,
163164 Err ( e) => Err ( anyhow ! (
164165 "Could not automatically determine release name:\n \t {e} \n \n \
Original file line number Diff line number Diff line change @@ -554,7 +554,7 @@ fn find_matching_revs(
554554 Ok ( ( prev_rev, rev) )
555555}
556556
557- pub fn find_head ( ) -> Result < String > {
557+ pub fn find_head_sha ( ) -> Result < String > {
558558 if let Some ( pr_head_sha) = std:: env:: var ( "GITHUB_EVENT_PATH" )
559559 . ok ( )
560560 . and_then ( |event_path| std:: fs:: read_to_string ( event_path) . ok ( ) )
@@ -1678,7 +1678,7 @@ mod tests {
16781678 fs:: write ( & event_file, pr_json) . expect ( "Failed to write event file" ) ;
16791679
16801680 std:: env:: set_var ( "GITHUB_EVENT_PATH" , event_file. to_str ( ) . unwrap ( ) ) ;
1681- let result = find_head ( ) ;
1681+ let result = find_head_sha ( ) ;
16821682 std:: env:: remove_var ( "GITHUB_EVENT_PATH" ) ;
16831683
16841684 assert ! ( result. is_ok( ) ) ;
You can’t perform that action at this time.
0 commit comments