Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions src/git/from_vcs.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,13 @@ def git_pieces_from_vcs(tag_prefix, root, verbose, runner=run_command):

# Strip off the leading "* " from the list of branches.
branches = [branch[2:] for branch in branches]
if "master" in branches:
branch_name = "master"
default_branch, rc = runner(GITS,
["rev-parse","--abbrev-ref","origin/HEAD"],
cwd=root)
# default_branch will be origin/<dafault_branch_name>
default_branch = default_branch.split('/')[-1]
if default_branch in branches:
branch_name = default_branch
elif not branches:
branch_name = None
else:
Expand Down