[sysadmin-bin] Check separately if master branch exists on GitHub



commit d296d5d9e91740e52ba59a37bc0c9b4491c41072
Author: Bartłomiej Piotrowski <bpiotrowski gnome org>
Date:   Tue Oct 29 08:39:52 2019 +0100

    Check separately if master branch exists on GitHub

 git/post-receive-mirror-github | 3 +++
 1 file changed, 3 insertions(+)
---
diff --git a/git/post-receive-mirror-github b/git/post-receive-mirror-github
index 3ffc1f8..f6e86af 100755
--- a/git/post-receive-mirror-github
+++ b/git/post-receive-mirror-github
@@ -222,6 +222,9 @@ def main():
 
     if github_settings['default_branch'] != "mainline":
         gh.update_github_repo(repo_name, 'default_branch', "mainline")
+
+    github_branches = gh.get_branches(repo_name)
+    if 'master' in github_branches:
         subprocess.run("git push --force git github com:{}/{} :master".format(gh.organization, 
github_repo_name), shell=True, check=True)
 
     for org in ADITIONAL_ORGANIZATIONS.get(repo_name, []):


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]