Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(755)

Unified Diff: scm.py

Issue 523094: Fix checkout root detection for git (Closed)
Patch Set: Created 10 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « gclient_utils.py ('k') | tests/trychange_unittest.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: scm.py
diff --git a/scm.py b/scm.py
index 998f9fb2661cc4b2a932d8aa1c9bfdb51aed1198..eabaad119c02d1bdf308fa48744b353beeb1e619 100644
--- a/scm.py
+++ b/scm.py
@@ -234,13 +234,11 @@ class GIT(object):
return "%s-%s" % (GIT.GetBranch(cwd), short_sha)
@staticmethod
- def GetCheckoutRoot(cwd):
- """Returns the top level directory of the current repository.
-
- The directory is returned as an absolute path.
+ def GetCheckoutRoot(path):
+ """Returns the top level directory of a git checkout as an absolute path.
"""
- return os.path.abspath(GIT.Capture(['rev-parse', '--show-cdup'],
- cwd).strip())
+ root = GIT.Capture(['rev-parse', '--show-cdup'], path).strip()
+ return os.path.abspath(os.path.join(path, root))
class SVN(object):
« no previous file with comments | « gclient_utils.py ('k') | tests/trychange_unittest.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698