From 66512ca253b73c173196080ea0929e49a521b379 Mon Sep 17 00:00:00 2001 From: Jesse Duffield Date: Wed, 5 Dec 2018 19:49:07 +1100 Subject: [PATCH] use porcelain git rather than go-git for reset --hard HEAD because go-git takes over 5 seconds --- pkg/commands/git.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkg/commands/git.go b/pkg/commands/git.go index 1d8e5a10d..e06b36d2e 100644 --- a/pkg/commands/git.go +++ b/pkg/commands/git.go @@ -208,9 +208,9 @@ func includesInt(list []int, a int) bool { return false } -// ResetHard does the equivalent of `git reset --hard HEAD` +// ResetHard clears the working tree to match HEAD func (c *GitCommand) ResetHard() error { - return c.Worktree.Reset(&gogit.ResetOptions{Mode: gogit.HardReset}) + return c.OSCommand.RunCommand("git reset --hard HEAD") } // UpstreamDifferenceCount checks how many pushables/pullables there are for the