Skip to content

Commit

Permalink
git: fix "git clean" invocation for submodule
Browse files Browse the repository at this point in the history
The command passed after a "git submodule foreach" should be invoked
as a single string, as it is on line 416 of this file. Otherwise "-x"
is treated as an argument to "foreach" and it errors. See
golang/dep#2176 for more details.
  • Loading branch information
kevinburke committed Jun 13, 2019
1 parent b4f5583 commit 5b2733d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion git.go
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ func (s *GitRepo) defendAgainstSubmodules() error {
return NewLocalError("Unexpected error while defensively cleaning up after possible derelict submodule directories", err, string(out))
}
// Then, repeat just in case there are any nested submodules that went away.
out, err = s.RunFromDir("git", "submodule", "foreach", "--recursive", "git", "clean", "-x", "-d", "-f", "-f")
out, err = s.RunFromDir("git", "submodule", "foreach", "--recursive", "git clean -x -d -f -f")
if err != nil {
return NewLocalError("Unexpected error while defensively cleaning up after possible derelict nested submodule directories", err, string(out))
}
Expand Down

0 comments on commit 5b2733d

Please sign in to comment.