Commit f089b03 1 parent 1f3cd41 commit f089b03 Copy full SHA for f089b03
File tree 1 file changed +13
-1
lines changed
1 file changed +13
-1
lines changed Original file line number Diff line number Diff line change @@ -261,6 +261,18 @@ def push(self, branch: str) -> None:
261
261
# you always want to push to origin, even from a fork
262
262
click .echo (self .git_cmd (["push" , ORIGIN_NAME , branch ]).stdout )
263
263
264
+ @staticmethod
265
+ def _parse_reponame_from_url (url : str ) -> str :
266
+ without_git_suffix = url .removesuffix (".git" )
267
+ if without_git_suffix .startswith ("https://" ) or without_git_suffix .startswith (
268
+ "http://"
269
+ ):
270
+ logger .info (f"Git remote url is in https form { without_git_suffix } " )
271
+ split = without_git_suffix .split ("/" )
272
+ return f"{ split [- 2 ]} /{ split [- 1 ]} "
273
+
274
+ return url .split (":" )[- 1 ]
275
+
264
276
def full_reponame (self ) -> str :
265
277
logger .debug (f"Trying to find { self .remote_name } in { self .remotes } " )
266
278
for remote in self .remotes :
@@ -271,7 +283,7 @@ def full_reponame(self) -> str:
271
283
logger .debug (
272
284
f"Remote { remote } found. Parsing its remote url { remote_url } "
273
285
)
274
- return remote_url . split ( ":" )[ - 1 ]. removesuffix ( ".git" )
286
+ return self . _parse_reponame_from_url ( remote_url )
275
287
276
288
logger .debug ("There are no remotes in this repo" )
277
289
return ""
You can’t perform that action at this time.
0 commit comments