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

Unified Diff: git_cl.py

Issue 335723002: Correct remote URL when uploading from a repo cloned from a git_cache. (Closed) Base URL: https://chromium.googlesource.com/chromium/tools/depot_tools.git@master
Patch Set: Created 6 years, 6 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: git_cl.py
diff --git a/git_cl.py b/git_cl.py
index c8c83309f4c47ac8decd1e698c67a1cf125d29b6..6a43b3d051e092173255fb74e14bca2472f3975f 100755
--- a/git_cl.py
+++ b/git_cl.py
@@ -658,7 +658,14 @@ or verify this branch is set up to track another (via the --track argument to
Returns None if there is no remote.
"""
remote, _ = self.GetRemoteBranch()
- return RunGit(['config', 'remote.%s.url' % remote], error_ok=True).strip()
+ url = RunGit(['config', 'remote.%s.url' % remote], error_ok=True).strip()
+
+ # If URL is pointing to a local directory, it is probably a git cache.
+ if os.path.isdir(url):
+ url = RunGit(['config', 'remote.%s.url' % remote],
+ error_ok=True,
+ cwd=url).strip()
+ return url
def GetIssue(self):
"""Returns the issue number as a int or None if not set."""
« 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