| # Copyright (c) 2021, the Dart project authors. Please see the AUTHORS file |
| # for details. All rights reserved. Use of this source code is governed by a |
| # BSD-style license that can be found in the LICENSE file. |
| # This python script is a wrapper around `git rev-parse --resolve-git-dir`. |
| # This is used for the build system to work with git worktrees. |
| raise Exception('Expects exactly 2 arguments.') |
| args = ['git', 'rev-parse', '--resolve-git-dir', sys.argv[1]] |
| windows = utils.GuessOS() == 'win32' |
| process = subprocess.Popen(args, |
| process = subprocess.Popen(args, |
| outs, _ = process.communicate() |
| if process.returncode != 0: |
| raise Exception('Got non-0 exit code from git.') |
| # Fall back to fall-back path. |
| if __name__ == '__main__': |