Commit de9b0d7a authored by Elouan Martinet's avatar Elouan Martinet
Browse files

Add git_list_branches function

parent 671a061912ec
......@@ -62,6 +62,14 @@ def git_pull_master(git_repo):
)
def git_list_branches(git_repo):
branches = cmd_lines(
["git", "for-each-ref", "--format=%(refname)", "refs/heads/"],
cwd=git_repo,
)
return [branch.split("/")[2] for branch in branches]
def hg_clone(path, destination):
cmd(
"Creating Mercurial repository",
......@@ -110,11 +118,7 @@ def _gfclone(git_fork_url, git_upstream_url, destination):
def _gfpull(git_repo):
branches = cmd_lines(
["git", "for-each-ref", "--format=%(refname)", "refs/heads/"],
cwd=git_repo,
)
branches = [branch.split("/")[2] for branch in branches]
branches = git_list_branches(git_repo)
git_pull_master(git_repo)
for branch in branches:
if branch != "master":
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment