Index: gclient_scm.py |
diff --git a/gclient_scm.py b/gclient_scm.py |
index 2cdee7df8a1d7823678c9b19048890fe5c04f2c6..62a9aa059b92d32fc1583014ea0540dc4e1402a2 100644 |
--- a/gclient_scm.py |
+++ b/gclient_scm.py |
@@ -262,7 +262,10 @@ class GitWrapper(SCMWrapper): |
self._CheckMinVersion("1.6.6") |
- default_rev = "refs/heads/master" |
+ if not options.nuclear: |
+ default_rev = "refs/heads/master" |
+ else: |
+ default_rev = "refs/remotes/origin/master" |
Dirk Pranke
2013/06/27 19:57:52
It seems like refs/heads/master can't be the right
|
url, deps_revision = gclient_utils.SplitUrlRevision(self.url) |
rev_str = "" |
revision = deps_revision |
@@ -276,6 +279,9 @@ class GitWrapper(SCMWrapper): |
if not revision: |
revision = default_rev |
+ if revision == 'HEAD' and options.nuclear: |
+ revision = 'refs/remotes/origin/master' |
Dirk Pranke
2013/06/27 19:57:52
This doesn't seem right. In what situation do we s
iannucci
2013/06/27 22:56:51
If we have deps e.g. third_party/WebKit@HEAD
|
+ |
if gclient_utils.IsDateRevision(revision): |
# Date-revisions only work on git-repositories if the reflog hasn't |
# expired yet. Use rev-list to get the corresponding revision. |
@@ -430,7 +436,8 @@ class GitWrapper(SCMWrapper): |
# This is a big hammer, debatable if it should even be here... |
if options.force or options.reset: |
- self._Run(['reset', '--hard', 'HEAD'], options) |
+ target = 'refs/remotes/origin/master' if options.nuclear else 'HEAD' |
Dirk Pranke
2013/06/27 19:57:52
Same sorts of comments as above, plus it's not cle
|
+ self._Run(['reset', '--hard', target], options) |
if current_type == 'detached': |
# case 0 |
@@ -577,7 +584,10 @@ class GitWrapper(SCMWrapper): |
# Don't reuse the args. |
return self.update(options, [], file_list) |
- default_rev = "refs/heads/master" |
+ if options.nuclear: |
+ default_rev = "refs/remotes/origin/master" |
+ else: |
+ default_rev = "refs/heads/master" |
_, deps_revision = gclient_utils.SplitUrlRevision(self.url) |
if not deps_revision: |
deps_revision = default_rev |