Преглед на файлове

Fix invalid usage of codearchiver.subprocess

Introduced by 240dcceb
tags/v1.0
JustAnotherArchivist преди 1 година
родител
ревизия
a6e256c58f
променени са 1 файла, в които са добавени 4 реда и са изтрити 4 реда
  1. +4
    -4
      codearchiver/modules/git.py

+ 4
- 4
codearchiver/modules/git.py Целия файл

@@ -50,10 +50,10 @@ class Git(codearchiver.core.Module):
if self._extraBranches:
for branch, commit in self._extraBranches.items():
_logger.info(f'Fetching commit {commit} as {branch}')
r = codearchiver.subprocess.run_with_log(['git', 'fetch', '--verbose', '--progress', 'origin', commit], cwd = directory, check = False)
if r.returncode == 0:
r2 = codearchiver.subprocess.run_with_log(['git', 'update-ref', f'refs/codearchiver/{branch}', commit, ''], cwd = directory, check = False)
if r2.returncode != 0:
r, _ = codearchiver.subprocess.run_with_log(['git', 'fetch', '--verbose', '--progress', 'origin', commit], cwd = directory, check = False)
if r == 0:
r2, _ = codearchiver.subprocess.run_with_log(['git', 'update-ref', f'refs/codearchiver/{branch}', commit, ''], cwd = directory, check = False)
if r2 != 0:
_logger.error(f'Failed to update-ref refs/codearchiver/{branch} to {commit}')
else:
_logger.error(f'Failed to fetch {commit}')


Зареждане…
Отказ
Запис