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

Unified Diff: gclient_utils.py

Issue 2200193003: Update top_dir with git repo root just when cwd locate in a git repo. (Closed) Base URL: https://chromium.googlesource.com/chromium/tools/depot_tools.git@master
Patch Set: Created 4 years, 4 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gclient_utils.py
diff --git a/gclient_utils.py b/gclient_utils.py
index 76cbe2df1de8a903fcdb70c1ab16cc7f7eaebefa..a988b824261132bca0ea9d7ff905daeacb96209b 100644
--- a/gclient_utils.py
+++ b/gclient_utils.py
@@ -671,7 +671,9 @@ def GetPrimarySolutionPath():
# checkout.
top_dir = [os.getcwd()]
def filter_fn(line):
- top_dir[0] = os.path.normpath(line.rstrip('\n'))
+ repo_root_path = os.path.normpath(line.rstrip('\n'))
+ if os.path.exists(repo_root_path):
+ top_dir[0] = repo_root_path
try:
CheckCallAndFilter(["git", "rev-parse", "--show-toplevel"],
print_stdout=False, filter_fn=filter_fn)
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698