git.py 367 B

123456789101112131415161718
  1. #!/usr/bin/env python
  2. #
  3. # Copyright 2019 Google Inc.
  4. #
  5. # Use of this source code is governed by a BSD-style license that can be
  6. # found in the LICENSE file.
  7. import subprocess
  8. import sys
  9. GIT = 'git.bat' if sys.platform == 'win32' else 'git'
  10. def git(*args):
  11. '''Run the given Git command, return the output.'''
  12. return subprocess.check_output([GIT]+list(args))