From f431e543a5f155fd64d397ae04d269c3907f42b7 Mon Sep 17 00:00:00 2001 From: Josh Hagins Date: Fri, 10 Jul 2015 09:46:35 -0400 Subject: [PATCH] update: explicitly no-ff merge and rebase. This overrides user configuration which may do otherwise. Closes Homebrew/homebrew#41570. Signed-off-by: Mike McQuaid --- Library/Homebrew/cmd/update.rb | 3 ++- Library/Homebrew/test/test_updater.rb | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/Library/Homebrew/cmd/update.rb b/Library/Homebrew/cmd/update.rb index 33678db3a9..1d4eb5928d 100644 --- a/Library/Homebrew/cmd/update.rb +++ b/Library/Homebrew/cmd/update.rb @@ -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 diff --git a/Library/Homebrew/test/test_updater.rb b/Library/Homebrew/test/test_updater.rb index 87e175ea3a..88f8c23aa7 100644 --- a/Library/Homebrew/test/test_updater.rb +++ b/Library/Homebrew/test/test_updater.rb @@ -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")