aboutsummaryrefslogtreecommitdiffstats
path: root/Library
diff options
context:
space:
mode:
authorJack Nagel2011-11-26 11:33:55 -0600
committerJack Nagel2011-11-26 11:44:55 -0600
commit83f28bc4c44e1fe565005b8f94320c38816a27f5 (patch)
treea44a53158adbdf55d13b32b3a205334c499d9b85 /Library
parent539536b268e75eddd84d84e4d2d31b8fc0a99b24 (diff)
downloadhomebrew-83f28bc4c44e1fe565005b8f94320c38816a27f5.tar.bz2
Reset to remote HEAD when updating git clones
Git checkouts that do not specify a branch should always reset to the remote's HEAD, as some remotes have HEAD set to 'unstable' or some other non-master branch. Signed-off-by: Jack Nagel <jacknagel@gmail.com>
Diffstat (limited to 'Library')
-rw-r--r--Library/Homebrew/download_strategy.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/Library/Homebrew/download_strategy.rb b/Library/Homebrew/download_strategy.rb
index a170459e6..a3996909e 100644
--- a/Library/Homebrew/download_strategy.rb
+++ b/Library/Homebrew/download_strategy.rb
@@ -366,8 +366,8 @@ class GitDownloadStrategy < AbstractDownloadStrategy
else
# otherwise the checkout-index won't checkout HEAD
# https://github.com/mxcl/homebrew/issues/7124
- # must specify origin/master, otherwise it resets to the current local HEAD
- quiet_safe_system "git", "reset", "--hard", "origin/master"
+ # must specify origin/HEAD, otherwise it resets to the current local HEAD
+ quiet_safe_system "git", "reset", "--hard", "origin/HEAD"
end
# http://stackoverflow.com/questions/160608/how-to-do-a-git-export-like-svn-export
safe_system 'git', 'checkout-index', '-a', '-f', "--prefix=#{dst}/"