File tree 1 file changed +6
-2
lines changed
1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -218,6 +218,8 @@ merge_or_rebase() {
218
218
if [[ " $DIR " = " $HOMEBREW_REPOSITORY " && -z " $HOMEBREW_NO_UPDATE_CLEANUP " ]]
219
219
then
220
220
UPSTREAM_TAG=" $( git tag --list --sort=-version:refname | head -n1) "
221
+ else
222
+ UPSTREAM_TAG=" "
221
223
fi
222
224
223
225
if [ -n " $UPSTREAM_TAG " ]
253
255
fi
254
256
255
257
INITIAL_BRANCH=" $( git symbolic-ref --short HEAD 2> /dev/null) "
256
- if [[ " $INITIAL_BRANCH " != " $UPSTREAM_BRANCH " && -n " $INITIAL_BRANCH " ]]
258
+ if [[ -n " $UPSTREAM_TAG " ]] ||
259
+ [[ " $INITIAL_BRANCH " != " $UPSTREAM_BRANCH " && -n " $INITIAL_BRANCH " ]]
257
260
then
258
261
259
262
if [[ -z " $HOMEBREW_NO_UPDATE_CLEANUP " ]]
265
268
266
269
# Recreate and check out `#{upstream_branch}` if unable to fast-forward
267
270
# it to `origin/#{@upstream_branch}`. Otherwise, just check it out.
268
- if git merge-base --is-ancestor " $UPSTREAM_BRANCH " " $REMOTE_REF " & > /dev/null
271
+ if [[ -z " $UPSTREAM_TAG " ]] &&
272
+ git merge-base --is-ancestor " $UPSTREAM_BRANCH " " $REMOTE_REF " & > /dev/null
269
273
then
270
274
git checkout --force " $UPSTREAM_BRANCH " " ${QUIET_ARGS[@]} "
271
275
else
You can’t perform that action at this time.
0 commit comments