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) |