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': |