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

Unified Diff: gclient_scm.py

Issue 262813002: gclient_scm: Only _DeleteOrMove if _Clone fails (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/depot_tools
Patch Set: Created 6 years, 8 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 | tests/gclient_scm_test.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gclient_scm.py
diff --git a/gclient_scm.py b/gclient_scm.py
index e0140515fa0ea47da8b0a53f51c7fd76932052ef..12450a70285e773c3b57f54d6f025cd4af3604d1 100644
--- a/gclient_scm.py
+++ b/gclient_scm.py
@@ -352,14 +352,11 @@ class GitWrapper(SCMWrapper):
if (not os.path.exists(self.checkout_path) or
(os.path.isdir(self.checkout_path) and
not os.path.exists(os.path.join(self.checkout_path, '.git')))):
- if (os.path.isdir(self.checkout_path) and
- not os.path.exists(os.path.join(self.checkout_path, '.git')) and
- os.listdir(self.checkout_path)):
- # This is a little hack to work around checkouts which are created
- # using "gclient config --name ."
- if not self.relpath == '.':
- self._DeleteOrMove(options.force)
- self._Clone(revision, url, options)
+ try:
+ self._Clone(revision, url, options)
+ except subprocess2.CalledProcessError:
+ self._DeleteOrMove(options.force)
+ self._Clone(revision, url, options)
self._UpdateBranchHeads(options, fetch=True)
if file_list is not None:
files = self._Capture(['ls-files']).splitlines()
« no previous file with comments | « no previous file | tests/gclient_scm_test.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698