infra/bots/recipe_modules/checkout/resources/assert_git_cipd.py
raw| 1 | # Copyright 2024 Google LLC |
| 2 | # |
| 3 | # Use of this source code is governed by a BSD-style license that can be |
| 4 | # found in the LICENSE file. |
| 5 | |
| 6 | import subprocess |
| 7 | import sys |
| 8 | |
| 9 | which = 'where' if sys.platform == 'win32' else 'which' |
| 10 | git = subprocess.check_output([which, 'git']).decode('utf-8') |
| 11 | print('git was found at %s' % git) |
| 12 | if 'cipd_bin_packages' not in git: |
| 13 | print('Git must be obtained through CIPD.', file=sys.stderr) |
| 14 | sys.exit(1) |