aboutsummaryrefslogtreecommitdiffstats
path: root/Library
diff options
context:
space:
mode:
authorJack Nagel2011-09-13 22:19:50 -0500
committerJack Nagel2011-09-13 22:26:36 -0500
commitbe7db9a453d6c8f4156e618a02d201dda1dd84e9 (patch)
tree40d67daab364e88a995d84ff0ad32069bf4e9110 /Library
parentc3565c8d4c7927970e172c8a8bd330915ead958d (diff)
downloadhomebrew-be7db9a453d6c8f4156e618a02d201dda1dd84e9.tar.bz2
Reset to remote master when updating git clones
When installing with --HEAD, cached repo clones do "git fetch origin" followed by "git reset --hard". This will only reset the working tree and index to the state of the local HEAD, but Homebrew will think it's updated and install anyway. "git reset --hard origin/master" will achieve the desired result. Should fix #7613. Signed-off-by: Jack Nagel <jacknagel@gmail.com>
Diffstat (limited to 'Library')
-rw-r--r--Library/Homebrew/download_strategy.rb3
1 files changed, 2 insertions, 1 deletions
diff --git a/Library/Homebrew/download_strategy.rb b/Library/Homebrew/download_strategy.rb
index cfdaaa7be..d043ef450 100644
--- a/Library/Homebrew/download_strategy.rb
+++ b/Library/Homebrew/download_strategy.rb
@@ -346,7 +346,8 @@ class GitDownloadStrategy < AbstractDownloadStrategy
else
# otherwise the checkout-index won't checkout HEAD
# https://github.com/mxcl/homebrew/issues/7124
- quiet_safe_system "git", "reset", "--hard"
+ # must specify origin/master, otherwise it resets to the current local HEAD
+ quiet_safe_system "git", "reset", "--hard", "origin/master"
end
# http://stackoverflow.com/questions/160608/how-to-do-a-git-export-like-svn-export
safe_system 'git', 'checkout-index', '-a', '-f', "--prefix=#{dst}/"