Lines Matching +full:- +full:- +full:git
3 # Use of this source code is governed by a BSD-style license that can be
6 """This module contains functions for using git."""
18 """Class to manage local git configs."""
26 prev = subprocess.check_output(['git', 'config', '--local', k]).rstrip()
32 subprocess.check_call(['git', 'config', '--local', k, v])
38 ['git', 'config', '--local', k, self._previous_values[k]])
40 subprocess.check_call(['git', 'config', '--local', '--unset', k])
44 """Class to manage git branches.
61 subprocess.check_call(['git', 'reset', '--hard', 'HEAD'])
62 subprocess.check_call(['git', 'checkout', 'main'])
63 if self._branch_name in subprocess.check_output(['git', 'branch']).split():
64 subprocess.check_call(['git', 'branch', '-D', self._branch_name])
65 subprocess.check_call(['git', 'checkout', '-b', self._branch_name,
66 '-t', 'origin/main'])
71 subprocess.check_call(['git', 'commit', '-a', '-m', self._commit_msg])
72 upload_cmd = ['git', 'cl', 'upload', '-f', '--bypass-hooks',
73 '--bypass-watchlists']
76 upload_cmd.extend(['-t', 'Patch set %d' % self._patch_set])
78 upload_cmd.append('--use-commit-queue')
79 # Need the --send-mail flag to publish the CL and remove WIP bit.
80 upload_cmd.append('--send-mail')
82 upload_cmd.extend(['--cc=%s' % ','.join(self._cc_list)])
84 output = subprocess.check_output(['git', 'cl', 'issue']).rstrip()
95 subprocess.check_call(['git', 'checkout', 'main'])
97 subprocess.check_call(['git', 'branch', '-D', self._branch_name])
101 """Creates a new local checkout of a Git repository."""
104 """Set parameters for this local copy of a Git repository.
119 (e.g., '/path/to/repo/.git') to check out a copy of
136 """Returns the root directory containing the checked-out files."""
148 subprocess.check_output(args=['git', 'clone', remote])
149 repo_name = remote.split('/')[-1]
150 if repo_name.endswith('.git'):
151 repo_name = repo_name[:-len('.git')]
156 'git', 'remote', 'set-url', 'origin', self._repository])
157 subprocess.check_call(['git', 'remote', 'update'])
158 subprocess.check_call(['git', 'checkout', 'main'])
159 subprocess.check_call(['git', 'reset', '--hard', 'origin/main'])