@@ -23,7 +23,7 @@ use crate::utils::mobile_app::{
2323} ;
2424use crate :: utils:: mobile_app:: { is_aab_file, is_apk_file, is_zip_file, normalize_directory} ;
2525use crate :: utils:: progress:: ProgressBar ;
26- use crate :: utils:: vcs;
26+ use crate :: utils:: vcs:: { self , get_provider_from_remote , get_repo_from_remote } ;
2727
2828pub fn make_command ( command : Command ) -> Command {
2929 #[ cfg( all( target_os = "macos" , target_arch = "aarch64" ) ) ]
@@ -92,6 +92,7 @@ pub fn make_command(command: Command) -> Command {
9292}
9393
9494pub fn execute ( matches : & ArgMatches ) -> Result < ( ) > {
95+ let config = Config :: current ( ) ;
9596 let path_strings = matches
9697 . get_many :: < String > ( "paths" )
9798 . expect ( "paths argument is required" ) ;
@@ -103,13 +104,24 @@ pub fn execute(matches: &ArgMatches) -> Result<()> {
103104 . or_else ( || vcs:: find_head ( ) . ok ( ) . map ( Cow :: Owned ) ) ;
104105
105106 let base_sha = matches. get_one ( "base_sha" ) . map ( String :: as_str) ;
106- let vcs_provider = matches. get_one ( "vcs_provider" ) . map ( String :: as_str) ;
107- let head_repo_name = matches. get_one ( "head_repo_name" ) . map ( String :: as_str) ;
108107 let base_repo_name = matches. get_one ( "base_repo_name" ) . map ( String :: as_str) ;
109108 let head_ref = matches. get_one ( "head_ref" ) . map ( String :: as_str) ;
110109 let base_ref = matches. get_one ( "base_ref" ) . map ( String :: as_str) ;
111110 let pr_number = matches. get_one :: < u32 > ( "pr_number" ) ;
112111
112+ let remote = config. get_cached_vcs_remote ( ) ;
113+
114+ let vcs_provider = matches
115+ . get_one ( "vcs_provider" )
116+ . map ( String :: as_str)
117+ . map ( Cow :: Borrowed )
118+ . or_else ( || Some ( Cow :: Owned ( get_provider_from_remote ( & remote) ) ) ) ;
119+ let head_repo_name = matches
120+ . get_one ( "head_repo_name" )
121+ . map ( String :: as_str)
122+ . map ( Cow :: Borrowed )
123+ . or_else ( || Some ( Cow :: Owned ( get_repo_from_remote ( & remote) ) ) ) ;
124+
113125 let build_configuration = matches. get_one ( "build_configuration" ) . map ( String :: as_str) ;
114126
115127 let api = Api :: current ( ) ;
@@ -171,8 +183,8 @@ pub fn execute(matches: &ArgMatches) -> Result<()> {
171183 let vcs_info = VcsInfo {
172184 head_sha : head_sha. as_deref ( ) ,
173185 base_sha,
174- vcs_provider,
175- head_repo_name,
186+ vcs_provider : vcs_provider . as_deref ( ) ,
187+ head_repo_name : head_repo_name . as_deref ( ) ,
176188 base_repo_name,
177189 head_ref,
178190 base_ref,
0 commit comments