From cba3ea7973e55c072a01a05f736aeca230346080 Mon Sep 17 00:00:00 2001 From: John Budorick Date: Thu, 10 Aug 2017 07:38:56 -0700 Subject: [PATCH] Generalize git index refresh to bot_update. (RELAND) Reland of https://chromium-review.googlesource.com/c/580327/ TBR=iannucci@chromium.org Bug: 746763 Change-Id: Icc3be87faa6c614a09b7406ce6e748abb2ad82da Reviewed-on: https://chromium-review.googlesource.com/581268 Commit-Queue: John Budorick Reviewed-by: John Budorick --- .../recipe_modules/bot_update/resources/bot_update.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/recipes/recipe_modules/bot_update/resources/bot_update.py b/recipes/recipe_modules/bot_update/resources/bot_update.py index 8b5943942..abf55f17a 100755 --- a/recipes/recipe_modules/bot_update/resources/bot_update.py +++ b/recipes/recipe_modules/bot_update/resources/bot_update.py @@ -1139,6 +1139,17 @@ def main(): solutions_printer(git_slns) + # Creating hardlinks during a build can interact with git reset in + # unfortunate ways if git's index isn't refreshed beforehand. (See + # crbug.com/330461#c13 for an explanation.) + try: + call_gclient('recurse', '-v', 'git', 'update-index', '--refresh') + except SubprocessFailed: + # Failure here (and nowhere else) may have adverse effects on the + # compile time of the build but shouldn't affect its ability to + # successfully complete. + print 'WARNING: Failed to update git indices.' + try: # Dun dun dun, the main part of bot_update. revisions, step_text, shallow = prepare(options, git_slns, active)