diff options
| -rw-r--r-- | Library/Homebrew/download_strategy.rb | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/Library/Homebrew/download_strategy.rb b/Library/Homebrew/download_strategy.rb index 3d5f2ade1..67b47e7a6 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 |
