@@ -23,7 +23,9 @@ 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:: { self , get_provider_from_remote, get_repo_from_remote} ;
26+ use crate :: utils:: vcs:: {
27+ self , get_provider_from_remote, get_repo_from_remote, git_repo_remote_url,
28+ } ;
2729
2830pub fn make_command ( command : Command ) -> Command {
2931 #[ cfg( all( target_os = "macos" , target_arch = "aarch64" ) ) ]
@@ -107,20 +109,8 @@ pub fn execute(matches: &ArgMatches) -> Result<()> {
107109 // Try to open the git repository and find the remote, but handle errors gracefully.
108110 let ( vcs_provider, head_repo_name) = {
109111 // Try to open the repo and get the remote URL, but don't fail if not in a repo.
110- let remote_url = match git2:: Repository :: open_from_env ( ) . and_then ( |repo| {
111- repo. find_remote ( & cached_remote) . and_then ( |remote| {
112- remote
113- . url ( )
114- . map ( |url| url. to_owned ( ) )
115- . ok_or_else ( || git2:: Error :: from_str ( "No remote URL found" ) )
116- } )
117- } ) {
118- Ok ( url) => Some ( url) ,
119- Err ( err) => {
120- debug ! ( "Could not determine git remote: {err}" ) ;
121- None
122- }
123- } ;
112+ let repo = git2:: Repository :: open_from_env ( ) . ok ( ) ;
113+ let remote_url = repo. and_then ( |repo| git_repo_remote_url ( & repo, & cached_remote) . ok ( ) ) ;
124114
125115 let vcs_provider: Option < Cow < ' _ , str > > = matches
126116 . get_one ( "vcs_provider" )
0 commit comments