diff --git a/Library/Homebrew/download_strategy.rb b/Library/Homebrew/download_strategy.rb index 3d5f2ade1a..67b47e7a60 100644 --- a/Library/Homebrew/download_strategy.rb +++ b/Library/Homebrew/download_strategy.rb @@ -570,7 +570,9 @@ class GitDownloadStrategy < VCSDownloadStrategy end def update_repo - unless @ref_type == :tag && has_ref? + # Branches always need updated. The has_ref? check will only work if a ref + # has been specified; if there isn't one we always want an update. + if @ref_type == :branch || !@ref || !has_ref? quiet_safe_system 'git', 'fetch', 'origin' end end