From a6e256c58f23ccf99227d3fbf47bd56a7a56fc21 Mon Sep 17 00:00:00 2001 From: JustAnotherArchivist Date: Thu, 9 Mar 2023 11:16:14 +0000 Subject: [PATCH] Fix invalid usage of codearchiver.subprocess Introduced by 240dcceb --- codearchiver/modules/git.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/codearchiver/modules/git.py b/codearchiver/modules/git.py index 9714809..6ce3a35 100644 --- a/codearchiver/modules/git.py +++ b/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}')