Commit 7f90416c authored by Edward Lemur's avatar Edward Lemur Committed by Commit Bot

depot_tools: Use git-checkout instead of git-rebase.

Changes like crrev.com/c/1752507, where a file that was previously in
.gitignore becomes part of the repo, makes update_depot_tools fail
to rebase.

Use git checkout origin/master instead.

Bug: 996359
Change-Id: Ib1a43b8842cebce96ab1fabaedc8e5653b9a708e
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1764708
Auto-Submit: Edward Lesmes <ehmaldonado@chromium.org>
Reviewed-by: 's avatarRobbie Iannucci <iannucci@chromium.org>
Commit-Queue: Robbie Iannucci <iannucci@chromium.org>
parent 4c55b355
...@@ -101,12 +101,11 @@ function update_git_repo { ...@@ -101,12 +101,11 @@ function update_git_repo {
git fetch -q origin &> /dev/null git fetch -q origin &> /dev/null
local REBASE_TXT STATUS local REBASE_TXT STATUS
REBASE_TXT=$(git rebase -q origin/master 2>&1) CHECKOUT_TXT=$(git checkout origin/master 2>&1)
STATUS=$? STATUS=$?
if [[ $STATUS -ne 0 ]]; then if [[ $STATUS -ne 0 ]]; then
echo "depot_tools update failed. Conflict in $base_dir" >&2 echo "depot_tools update failed. Conflict in $base_dir" >&2
echo "$REBASE_TXT" >&2 echo "$CHECKOUT_TXT" >&2
git rebase --abort 2> /dev/null
fi fi
return $STATUS return $STATUS
} }
......
...@@ -51,7 +51,7 @@ for /F %%x in ('git config --get remote.origin.url') DO ( ...@@ -51,7 +51,7 @@ for /F %%x in ('git config --get remote.origin.url') DO (
) )
) )
call git fetch -q origin > NUL call git fetch -q origin > NUL
call git rebase -q origin/master > NUL call git checkout origin/master > NUL
if errorlevel 1 ( if errorlevel 1 (
echo Failed to update depot_tools. echo Failed to update depot_tools.
goto :EOF goto :EOF
......
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