OLD | NEW |
1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
2 # Copyright (c) 2014 The Chromium Authors. All rights reserved. | 2 # Copyright (c) 2014 The Chromium Authors. All rights reserved. |
3 # Use of this source code is governed by a BSD-style license that can be | 3 # Use of this source code is governed by a BSD-style license that can be |
4 # found in the LICENSE file. | 4 # found in the LICENSE file. |
5 | 5 |
6 """This module contains functions for using git.""" | 6 """This module contains functions for using git.""" |
7 | 7 |
8 | 8 |
9 import os | 9 import os |
10 import shell_utils | 10 import shell_utils |
(...skipping 22 matching lines...) Expand all Loading... |
33 # Get full hash since that is what was returned by rev-parse. | 33 # Get full hash since that is what was returned by rev-parse. |
34 return FullHash(commit) != last_non_merge | 34 return FullHash(commit) != last_non_merge |
35 | 35 |
36 def MergeAbort(): | 36 def MergeAbort(): |
37 """Abort in process merge.""" | 37 """Abort in process merge.""" |
38 shell_utils.run([GIT, 'merge', '--abort']) | 38 shell_utils.run([GIT, 'merge', '--abort']) |
39 | 39 |
40 def ShortHash(commit): | 40 def ShortHash(commit): |
41 """Return short hash of the specified commit.""" | 41 """Return short hash of the specified commit.""" |
42 return shell_utils.run([GIT, 'show', commit, '--format=%h', '-s']).rstrip() | 42 return shell_utils.run([GIT, 'show', commit, '--format=%h', '-s']).rstrip() |
| 43 |
| 44 def GetRemoteMasterHash(git_url): |
| 45 return shell_utils.run([GIT, 'ls-remote', git_url, '--verify', |
| 46 'refs/heads/master']) |
OLD | NEW |