Skip to content

Commit

Permalink
chore: include sparse-checkout in fake runner w. git clone
Browse files Browse the repository at this point in the history
  • Loading branch information
GavinPJK committed Nov 7, 2024
1 parent e2bf7ac commit 0344302
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion pkg/fakerunners/git_cloner.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,11 @@ import (
func NewFakeRunnerWithGitClone() *fakerunner.FakeRunner {
return &fakerunner.FakeRunner{
CommandRunner: func(command *cmdrunner.Command) (string, error) {
if command.Name == "git" && len(command.Args) > 1 && command.Args[0] == "clone" {
if command.Name == "git" && len(command.Args) > 1 {
if command.Args[0] == "clone" || command.Args[0] == "sparse-checkout" {
return cmdrunner.DefaultCommandRunner(command)
}
} else if command.Args[0] == "checkout" {
return cmdrunner.DefaultCommandRunner(command)
}
return "fake " + command.CLI(), nil
Expand Down

0 comments on commit 0344302

Please sign in to comment.