From 3505509bae834278a1c57d77836c24f4ba509e41 Mon Sep 17 00:00:00 2001 From: Mike McQuaid Date: Thu, 18 Feb 2016 10:38:30 +0000 Subject: [PATCH] update: better handle merge conflicts. When there are merge conflicts we fail pretty hard. This is still possible after this commit but at least we've given Git enough pointers to make it less likely. Closes Homebrew/homebrew#49299. Signed-off-by: Mike McQuaid --- Library/Homebrew/cmd/update.sh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Library/Homebrew/cmd/update.sh b/Library/Homebrew/cmd/update.sh index 008b1550c8..8c2107a838 100644 --- a/Library/Homebrew/cmd/update.sh +++ b/Library/Homebrew/cmd/update.sh @@ -203,6 +203,7 @@ pull() { echo "Stashing uncommitted changes to $DIR." git status --short --untracked-files=all fi + git merge --abort &>/dev/null git -c "user.email=brew-update@localhost" \ -c "user.name=brew update" \ stash save --include-untracked "${QUIET_ARGS[@]}" @@ -232,7 +233,10 @@ pull() { then git rebase "${QUIET_ARGS[@]}" "origin/$UPSTREAM_BRANCH" else - git merge --no-edit --ff "${QUIET_ARGS[@]}" "origin/$UPSTREAM_BRANCH" + git merge --no-edit --ff "${QUIET_ARGS[@]}" "origin/$UPSTREAM_BRANCH" \ + --strategy=recursive \ + --strategy-option=ours \ + --strategy-option=ignore-all-space fi export HOMEBREW_UPDATE_AFTER"$TAP_VAR"="$(read_current_revision)"