aboutsummaryrefslogtreecommitdiffstats
path: root/Library
diff options
context:
space:
mode:
authorMike McQuaid2016-02-18 10:38:30 +0000
committerMike McQuaid2016-02-22 09:00:35 +0000
commit3505509bae834278a1c57d77836c24f4ba509e41 (patch)
tree3d4a24db4816ac7bfc66b09ee64551bc8e9eb667 /Library
parentcc3e2e8f0f7dc87c74a17ce40227cc555aa38f4f (diff)
downloadbrew-3505509bae834278a1c57d77836c24f4ba509e41.tar.bz2
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 <mike@mikemcquaid.com>
Diffstat (limited to 'Library')
-rw-r--r--Library/Homebrew/cmd/update.sh6
1 files changed, 5 insertions, 1 deletions
diff --git a/Library/Homebrew/cmd/update.sh b/Library/Homebrew/cmd/update.sh
index 008b1550c..8c2107a83 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)"