update: explicitly no-ff merge and rebase.

This overrides user configuration which may do otherwise.

Closes Homebrew/homebrew#41570.

Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
This commit is contained in:
Josh Hagins 2015-07-10 09:46:35 -04:00 committed by Mike McQuaid
parent 8d2e757253
commit f431e543a5
2 changed files with 3 additions and 2 deletions

View File

@ -196,7 +196,8 @@ class Updater
safe_system "git", "config", "core.autocrlf", "false"
args = ["pull"]
args << "--rebase" if ARGV.include? "--rebase"
args << "--ff"
args << ((ARGV.include? "--rebase") ? "--rebase" : "--no-rebase")
args += quiet
args << "origin"
# the refspec ensures that 'origin/master' gets updated

View File

@ -61,7 +61,7 @@ class UpdaterTests < Homebrew::TestCase
@updater.in_repo_expect("git symbolic-ref --short HEAD", "master")
@updater.in_repo_expect("git rev-parse -q --verify HEAD", "1234abcd")
@updater.in_repo_expect("git config core.autocrlf false")
@updater.in_repo_expect("git pull --quiet origin refs/heads/master:refs/remotes/origin/master")
@updater.in_repo_expect("git pull --ff --no-rebase --quiet origin refs/heads/master:refs/remotes/origin/master")
@updater.in_repo_expect("git rev-parse -q --verify HEAD", "3456cdef")
@updater.pull!(:silent => true)
@updater.in_repo_expect("git rev-parse -q --verify HEAD", "3456cdef")