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

Unified Diff: gclient_scm.py

Issue 2447813003: Call status before reset in gclient sync. (Closed)
Patch Set: Add comment Created 4 years, 2 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 4a4e6015461582fbf28a1034f63e66aba1e26770..49e53f6bfbd3945ebdf2308fbc2db8ec80d9a376 100644
--- a/gclient_scm.py
+++ b/gclient_scm.py
@@ -534,6 +534,13 @@ class GitWrapper(SCMWrapper):
target = 'HEAD'
if options.upstream and upstream_branch:
target = upstream_branch
+
+ # Builds can create hard links which update source files' ctimes, causing
+ # git to become confused over what files are out-of-date. Calling
+ # `git status` resynchronizes git and allows `git reset --hard` to not
+ # re-checkout files (and thus forcing unnecessary rebuilds)".
+ self._Run(['status'], options)
+
self._Run(['reset', '--hard', target], options)
if current_type == 'detached':
« 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