From f0d93a6655c41d85679387e48c73b92da685f65d Mon Sep 17 00:00:00 2001 From: Daniele Rondina Date: Mon, 20 May 2019 23:41:24 +0200 Subject: [PATCH] gps: pass correct arguments to "git clean" Previously, the "-x" in git submodule foreach --recursive git clean -x was being applied to the "git submodule" command not the "git clean" command. git submodule foreach expects the inner command to be wrapped in a single string, so pass git clean as a single string. Verified this works as expected on the command line. Fixes #2164. Fixes #2168. --- gps/vcs_repo.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/gps/vcs_repo.go b/gps/vcs_repo.go index 0835b35736..55ba20aaa0 100644 --- a/gps/vcs_repo.go +++ b/gps/vcs_repo.go @@ -146,8 +146,7 @@ func (r *gitRepo) defendAgainstSubmodules(ctx context.Context) error { "submodule", "foreach", "--recursive", - "git", - "clean", "-x", "-d", "-f", "-f", + "git clean -x -d -f -f", ) cmd.SetDir(r.LocalPath()) if out, err := cmd.CombinedOutput(); err != nil {