Commit 2b4da122 authored by Andrii Shyshkalov's avatar Andrii Shyshkalov Committed by Commit Bot

bot_update: speculative fix for gerrit patch application failure.

bot_update doesn't properly cleanup git index state from unmerged paths,
which are likely if Rietveld patches were failed to be applied in prior
runs in the same checkout dir.

R=machenbach@chromium.org
BUG=692067

Change-Id: I8fd326caefce8623731697a368cbad3159405257
Reviewed-on: https://chromium-review.googlesource.com/442426
Commit-Queue: Andrii Shyshkalov <tandrii@chromium.org>
Reviewed-by: 's avatarMichael Achenbach <machenbach@chromium.org>
parent 014cb038
......@@ -659,6 +659,12 @@ def apply_gerrit_ref(gerrit_repo, gerrit_ref, root, gerrit_reset,
print '===Applying gerrit ref==='
print 'Repo is %r @ %r, ref is %r, root is %r' % (
gerrit_repo, base_rev, gerrit_ref, root)
# TODO(tandrii): move the fix below to common rietveld/gerrit codepath.
# Speculative fix: prior bot_update run with Rietveld patch may leave git
# index with unmerged paths. bot_update calls 'checkout --force xyz' thus
# ignoring such paths, but potentially never cleaning them up. The following
# command will do so. See http://crbug.com/692067.
git('reset', '--hard', cwd=root)
try:
git('retry', 'fetch', gerrit_repo, gerrit_ref, cwd=root, tries=1)
git('checkout', 'FETCH_HEAD', cwd=root)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment