From 0bb197026afef73ebebc26a2e153a3175aef3852 Mon Sep 17 00:00:00 2001 From: Dmitry Vyukov Date: Sat, 4 Jul 2020 08:29:18 +0200 Subject: pkg/vcs: reset state even more "git clean -fd" does not remove ignored files, while can mess state when .gitignore changes across commits. Use "git clean -fdx" to delete ignored files as well. --- pkg/vcs/git.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'pkg') diff --git a/pkg/vcs/git.go b/pkg/vcs/git.go index 49a795e12..557a0dfe7 100644 --- a/pkg/vcs/git.go +++ b/pkg/vcs/git.go @@ -123,6 +123,7 @@ func (git *git) fetchRemote(repo string) error { func (git *git) SwitchCommit(commit string) (*Commit, error) { git.git("reset", "--hard") + git.git("clean", "-fdx") if _, err := git.git("checkout", commit); err != nil { return nil, err } @@ -145,7 +146,7 @@ func (git *git) clone(repo, branch string) error { func (git *git) reset() { // This function tries to reset git repo state to a known clean state. git.git("reset", "--hard") - git.git("clean", "-fd") + git.git("clean", "-fdx") git.git("bisect", "reset") git.git("reset", "--hard") } -- cgit mrf-deployment