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

Unified Diff: gclient_scm.py

Issue 334633004: Allow gclient sync to overwrite untracked files when moving detached git HEAD. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/depot_tools
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: gclient_scm.py
diff --git a/gclient_scm.py b/gclient_scm.py
index 67d68674e04fd5f0c42084529551a1fa35c181f5..3394fd825e9e9ac8a77bf8af5bb0089aff2b7a9a 100644
--- a/gclient_scm.py
+++ b/gclient_scm.py
@@ -486,7 +486,12 @@ class GitWrapper(SCMWrapper):
if self._Capture(['rev-list', '-n', '1', 'HEAD']) == revision:
self.Print('Up-to-date; skipping checkout.')
else:
- self._Capture(['checkout', '--quiet', '%s' % revision])
+ # 'git checkout' may need to overwrite existing untracked files. Allow
+ # it only when nuclear options are enabled.
+ if options.force and options.delete_unversioned_trees:
Vadim Sh. 2014/06/20 06:46:46 The more natural combination would be "--force --r
+ self._Capture(['checkout', '--force', '--quiet', '%s' % revision])
+ else:
+ self._Capture(['checkout', '--quiet', '%s' % revision])
if not printed_path:
self.Print('_____ %s%s' % (self.relpath, rev_str), timestamp=False)
elif current_type == 'hash':
« 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