Call status before reset in gclient sync.

Calling status before reset will ensure files that have no been changed do not
get deleted by reset --hard.

BUG=642711

Review-Url: https://codereview.chromium.org/2447813003
changes/96/408096/1
justincohen 9 years ago committed by Commit bot
parent c3937b9128
commit d74a7b4c14

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

Loading…
Cancel
Save