Skip to content

Commit

Permalink
donate-cpu.py: avoid unnecessary git checkout invocation if non-`ma…
Browse files Browse the repository at this point in the history
…in` binary already exists
  • Loading branch information
firewave committed Oct 23, 2023
1 parent 2d1c8d4 commit 8140adf
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions tools/donate-cpu.py
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,9 @@
if ver == 'head':
ver = 'main'
current_cppcheck_dir = os.path.join(work_path, 'tree-'+ver)
if ver != 'main' and lib.has_binary(current_cppcheck_dir):
print('No need to check Cppcheck-{} for changes - binary already exists'.format(ver))
continue
print('Checking Cppcheck-{} for changes..'.format(ver))
try:
has_changes = lib.try_retry(lib.checkout_cppcheck_version, fargs=(repo_path, ver, current_cppcheck_dir), max_tries=3, sleep_duration=30.0, sleep_factor=1.0)
Expand Down

0 comments on commit 8140adf

Please sign in to comment.