From 554147fa99eaad902785ac7f7c2daaa7c5321f8a Mon Sep 17 00:00:00 2001 From: Max Howell Date: Sat, 6 Aug 2011 11:11:06 +0100 Subject: [PATCH] Reset --hard after the first git init We don't know what revision the tarball was when homebrew was installed, so all we can do really is hard reset. In theory some set of git commands should suffice, but apparently --soft and --mixed resets ended up putting stuff in the index which would break subsequent `brew updates`. Fixes Homebrew/homebrew#6851 --- Library/Homebrew/cmd/update.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Library/Homebrew/cmd/update.rb b/Library/Homebrew/cmd/update.rb index c225b91761..03ff290719 100644 --- a/Library/Homebrew/cmd/update.rb +++ b/Library/Homebrew/cmd/update.rb @@ -42,7 +42,7 @@ class RefreshBrew begin safe_system "git init" safe_system "git fetch #{REPOSITORY_URL}" - safe_system "git reset --soft FETCH_HEAD" + safe_system "git reset --hard FETCH_HEAD" rescue Exception safe_system "rm -rf .git" raise