Commit 090af0fa authored by Guilhem Saurel's avatar Guilhem Saurel

and in this case, don't create refs

parent b6dd0c69
Pipeline #8508 passed with stage
in 53 seconds
......@@ -89,10 +89,6 @@ def push(request: HttpRequest, rep: str) -> HttpResponse:
git_repo.branches[gh_ref_s].commit = data['after']
else:
git_repo.create_head(gh_ref_s, commit=data['after'])
if gl_ref_s in git_repo.branches:
git_repo.branches[gl_ref_s].commit = data['after']
else:
git_repo.create_head(gl_ref_s, commit=data['after'])
if ref_s in git_repo.branches:
git_repo.branches[ref_s].commit = data['after']
else:
......@@ -102,6 +98,11 @@ def push(request: HttpRequest, rep: str) -> HttpResponse:
print(f'project {project} not available on {gl_remote_s}')
return HttpResponse(rep)
if gl_ref_s in git_repo.branches:
git_repo.branches[gl_ref_s].commit = data['after']
else:
git_repo.create_head(gl_ref_s, commit=data['after'])
gl_remote = git_repo.remotes[gl_remote_s]
gl_remote.fetch()
if ref_s not in gl_remote.refs or str(gl_remote.refs[ref_s].commit) != data['after']:
......
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