From 42e9782dd61eb991f29b5355575cca3265de77a9 Mon Sep 17 00:00:00 2001 From: Mike McQuaid Date: Sun, 18 Sep 2016 20:25:18 +0100 Subject: [PATCH] update-report: cleanup git harder in migration. Before stashing also try to cancel any current merge, rebase and reset. This will prevent any data loss but also make the stash more likely to succeed. --- Library/Homebrew/cmd/update-report.rb | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Library/Homebrew/cmd/update-report.rb b/Library/Homebrew/cmd/update-report.rb index 57b18b8656..f646424693 100644 --- a/Library/Homebrew/cmd/update-report.rb +++ b/Library/Homebrew/cmd/update-report.rb @@ -208,6 +208,9 @@ module Homebrew unless Utils.popen_read("git status --untracked-files=all --porcelain").empty? HOMEBREW_REPOSITORY.cd do + quiet_system "git", "merge", "--abort" + quiet_system "git", "rebase", "--abort" + quiet_system "git", "reset", "--mixed" safe_system "git", "-c", "user.email=brew-update@localhost", "-c", "user.name=brew update", "stash", "save", "--include-untracked"