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

Unified Diff: gclient_scm.py

Issue 1916973002: Gclient: Don't check if repository is clean if --force is passed in (Closed) Base URL: https://chromium.googlesource.com/chromium/tools/depot_tools.git@master
Patch Set: Plan B Created 4 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 | 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 9a6f5123419cef246e638dc28ae3caf0679cd4ee..79fb6ea58f2fa9d34d9e6b1c08ea97e3aadf5c41 100644
--- a/gclient_scm.py
+++ b/gclient_scm.py
@@ -553,7 +553,9 @@ class GitWrapper(SCMWrapper):
if current_type == 'detached':
# case 0
- self._CheckClean(rev_str)
+ if not options.force:
+ # Don't do this check if nuclear option is on.
+ self._CheckClean(rev_str)
self._CheckDetachedHead(rev_str, options)
if self._Capture(['rev-list', '-n', '1', 'HEAD']) == revision:
self.Print('Up-to-date; skipping checkout.')
@@ -563,7 +565,7 @@ class GitWrapper(SCMWrapper):
self._Checkout(
options,
revision,
- force=(options.force and options.delete_unversioned_trees),
+ force=(options.force or options.delete_unversioned_trees),
quiet=True,
)
if not printed_path:
« 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