tools: Update source repos in total-contributions.

Otherwise, the output will incorrectly exclude any new commits in
repositories you'd used this tool with previously.
This commit is contained in:
Tim Abbott
2022-10-31 16:26:30 -07:00
parent 8b352e9321
commit 8023a646de

View File

@@ -171,7 +171,13 @@ for (full_repository, branch) in [
]:
repository = os.path.basename(full_repository)
if not os.path.exists(find_path(repository)):
if os.path.exists(find_path(repository)):
# Update the checkout for the project in question.
subprocess.check_call(
["git", "pull", "--rebase", "-q"],
cwd=find_path(repository),
)
else:
subprocess.check_call(
["git", "clone", f"git@github.com:{full_repository}.git"],
cwd=os.path.dirname(find_path(repository)),