@@ -117,12 +117,12 @@ def confirm_proceeding_with_no_git_repo() -> str | bool:
117117 return True
118118
119119
120- def check_and_push_branch (repo : git .Repo , wait_for_push : bool = False ) -> bool : # noqa: FBT001, FBT002
120+ def check_and_push_branch (repo : git .Repo , git_remote : str , wait_for_push : bool = False ) -> bool : # noqa: FBT001, FBT002
121121 current_branch = repo .active_branch .name
122- origin = repo .remote (name = "origin" )
122+ remote = repo .remote (name = git_remote )
123123
124124 # Check if the branch is pushed
125- if f"origin /{ current_branch } " not in repo .refs :
125+ if f"{ git_remote } /{ current_branch } " not in repo .refs :
126126 logger .warning (f"⚠️ The branch '{ current_branch } ' is not pushed to the remote repository." )
127127 if not sys .__stdin__ .isatty ():
128128 logger .warning ("Non-interactive shell detected. Branch will not be pushed." )
@@ -132,13 +132,13 @@ def check_and_push_branch(repo: git.Repo, wait_for_push: bool = False) -> bool:
132132 f"the branch '{ current_branch } ' to the remote repository?" ,
133133 default = False ,
134134 ):
135- origin .push (current_branch )
136- logger .info (f"⬆️ Branch '{ current_branch } ' has been pushed to origin ." )
135+ remote .push (current_branch )
136+ logger .info (f"⬆️ Branch '{ current_branch } ' has been pushed to { git_remote } ." )
137137 if wait_for_push :
138138 time .sleep (3 ) # adding this to give time for the push to register with GitHub,
139139 # so that our modifications to it are not rejected
140140 return True
141- logger .info (f"🔘 Branch '{ current_branch } ' has not been pushed to origin ." )
141+ logger .info (f"🔘 Branch '{ current_branch } ' has not been pushed to { git_remote } ." )
142142 return False
143143 logger .debug (f"The branch '{ current_branch } ' is present in the remote repository." )
144144 return True
0 commit comments