|
|
@@ -50,17 +50,17 @@ 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) |
|
|
|
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) |
|
|
|
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}') |
|
|
|
|
|
|
|
_logger.info(f'Collecting repository metadata for index') |
|
|
|
_, refs = codearchiver.subprocess.run_with_log(['git', 'show-ref'], cwd = directory) |
|
|
|
_, commits = codearchiver.subprocess.run_with_log(['git', 'log', '--reflog', '--all', '--format=format:%H% P'], cwd = directory) |
|
|
|
_, refs, _ = codearchiver.subprocess.run_with_log(['git', 'show-ref'], cwd = directory) |
|
|
|
_, commits, _ = codearchiver.subprocess.run_with_log(['git', 'log', '--reflog', '--all', '--format=format:%H% P'], cwd = directory) |
|
|
|
commits = list(map(functools.partial(str.split, sep = ' '), commits.splitlines())) |
|
|
|
rootCommits = [c[0] for c in commits if len(c) == 1] |
|
|
|
|
|
|
|