File tree Expand file tree Collapse file tree 1 file changed +5
-11
lines changed Expand file tree Collapse file tree 1 file changed +5
-11
lines changed Original file line number Diff line number Diff line change @@ -521,14 +521,8 @@ def get_current_remote_name(self):
521521
522522 :rtype: str, None if no remote set
523523 """
524- current_status = self .run (['status' , '-sb' ])
525- # git status -sb
526- # ## v1.0-ourbranch...remotename/v1.0-ourbranch
527- match = re .match (
528- r'^## (?P<branch>.*)\.{3}(?P<remote_slash_branch>.*)' , current_status ,
529- )
530- if match is None : # No upstream set
531- return None
532- return match .group ('remote_slash_branch' ).replace (
533- '/' + match .group ('branch' ), ''
534- )
524+ match = extract_status (self .run (['status' , '-sb' , '--porcelain=2' ]))
525+
526+ if match ['branch_upstream' ] is None : # no upstream set
527+ return match ['branch_head' ]
528+ return match ['branch_upstream' ].replace ('/' + match ['branch_head' ], '' )
You can’t perform that action at this time.
0 commit comments