Chromium Code Reviews| Index: scm.py |
| diff --git a/scm.py b/scm.py |
| index 30bb3d17ea49bd74c0a83af490bbc486d60e3f41..d6e84fe7ae0e0713b6ca4c338a1f16e54b7ff450 100644 |
| --- a/scm.py |
| +++ b/scm.py |
| @@ -141,6 +141,10 @@ class GIT(object): |
| return results |
| @staticmethod |
| + def IsWorkTreeDirty(cwd): |
| + return GIT.Capture(['status', '-s'], cwd=cwd) != '' |
| + |
| + @staticmethod |
| def GetEmail(cwd): |
| """Retrieves the user email address if known.""" |
| # We could want to look at the svn cred when it has a svn remote but it |
| @@ -390,6 +394,17 @@ class GIT(object): |
| return os.path.abspath(os.path.join(cwd, root)) |
| @staticmethod |
| + def GetGitDir(cwd): |
| + return GIT.Capture(['rev-parse', '--git-dir'], cwd=cwd) |
|
agable
2014/03/04 21:45:59
Note that this returns a relative path if you're a
nodir
2014/03/04 22:51:19
Done.
|
| + |
| + @staticmethod |
| + def IsInsideWorkTree(cwd): |
| + try: |
| + return GIT.Capture(['rev-parse', '--is-inside-work-tree'], cwd=cwd) |
| + except (OSError, subprocess2.CalledProcessError): |
| + return False |
| + |
| + @staticmethod |
| def GetGitSvnHeadRev(cwd): |
| """Gets the most recently pulled git-svn revision.""" |
| try: |