aboutsummaryrefslogtreecommitdiffstats
path: root/Library
diff options
context:
space:
mode:
authorMike McQuaid2016-09-18 15:32:44 +0100
committerGitHub2016-09-18 15:32:44 +0100
commitad466452de31412ccfd5cd08edda0ae9472c8ab2 (patch)
tree416c34086136d73c695841873b08f82047fa5d53 /Library
parent59b7f16bfd9c1968aae0a2f1cd9a43d3d160d99f (diff)
parentd70841db2bcccb089382ffb940ce8a8bc3de22d4 (diff)
downloadbrew-ad466452de31412ccfd5cd08edda0ae9472c8ab2.tar.bz2
Merge pull request #1007 from MikeMcQuaid/update-remote-ref
update.sh: turn origin/branch into a variable.
Diffstat (limited to 'Library')
-rw-r--r--Library/Homebrew/cmd/update.sh10
1 files changed, 6 insertions, 4 deletions
diff --git a/Library/Homebrew/cmd/update.sh b/Library/Homebrew/cmd/update.sh
index 67b3699ed..8f02579c3 100644
--- a/Library/Homebrew/cmd/update.sh
+++ b/Library/Homebrew/cmd/update.sh
@@ -215,6 +215,8 @@ merge_or_rebase() {
trap reset_on_interrupt SIGINT
+ REMOTE_REF="origin/$UPSTREAM_BRANCH"
+
if [[ -n "$(git status --untracked-files=all --porcelain 2>/dev/null)" ]]
then
if [[ -n "$HOMEBREW_VERBOSE" ]]
@@ -252,11 +254,11 @@ EOS
# Recreate and check out `#{upstream_branch}` if unable to fast-forward
# it to `origin/#{@upstream_branch}`. Otherwise, just check it out.
- if git merge-base --is-ancestor "$UPSTREAM_BRANCH" "origin/$UPSTREAM_BRANCH" &>/dev/null
+ if git merge-base --is-ancestor "$UPSTREAM_BRANCH" "$REMOTE_REF" &>/dev/null
then
git checkout --force "$UPSTREAM_BRANCH" "${QUIET_ARGS[@]}"
else
- git checkout --force -B "$UPSTREAM_BRANCH" "origin/$UPSTREAM_BRANCH" "${QUIET_ARGS[@]}"
+ git checkout --force -B "$UPSTREAM_BRANCH" "$REMOTE_REF" "${QUIET_ARGS[@]}"
fi
fi
@@ -268,9 +270,9 @@ EOS
if [[ -z "$HOMEBREW_MERGE" ]]
then
- git rebase "${QUIET_ARGS[@]}" "origin/$UPSTREAM_BRANCH"
+ git rebase "${QUIET_ARGS[@]}" "$REMOTE_REF"
else
- git merge --no-edit --ff "${QUIET_ARGS[@]}" "origin/$UPSTREAM_BRANCH" \
+ git merge --no-edit --ff "${QUIET_ARGS[@]}" "$REMOTE_REF" \
--strategy=recursive \
--strategy-option=ours \
--strategy-option=ignore-all-space