This commit is contained in:
proletarius101 2024-04-06 17:09:31 +08:00
parent cd23cf659b
commit 31f9919073
No known key found for this signature in database
1 changed files with 4 additions and 2 deletions

View File

@ -519,7 +519,7 @@ def update_servergitmirrors(servergitmirrors, repo_section):
branch_name = 'full'
if not branch_name in repo.heads:
repo.create_head(branch_name, initial_branch_ref)
repo.heads[branch_name].checkout()
repo.head.reference = repo.heads[branch_name]
remote_url = d['url']
name = REMOTE_HOSTNAME_REGEX.sub(r'\1', remote_url)
@ -556,6 +556,9 @@ def update_servergitmirrors(servergitmirrors, repo_section):
% (common.GITLAB_COM_PAGES_MAX_SIZE / 1000000000)
)
# Test
print(repo.head.log())
# push. This will overwrite the git history
remote = repo.remote(name)
if remote.name == 'gitlab':
@ -603,7 +606,6 @@ def update_servergitmirrors(servergitmirrors, repo_section):
repo.head.reference = initial_branch_ref
repo.head.reset(index=True, working_tree=False)
repo.delete_head(repo.branches[branch_name], force=True)
if progress:
progressbar.done()