MCPcopy
hub / github.com/redspread/spread / ExecGitCmd

Method ExecGitCmd

cli/git.go:21–37  ·  view source on GitHub ↗
(args ...string)

Source from the content-addressed store, hash-verified

19}
20
21func (s SpreadCli) ExecGitCmd(args ...string) {
22 git, err := exec.LookPath("git")
23 if err != nil {
24 s.fatalf("Could not locate git: %v", err)
25 }
26
27 proj := s.projectOrDie()
28 gitDir := filepath.Join(proj.Path, "git")
29
30 gitArgs := []string{git, "--git-dir=" + gitDir}
31 gitArgs = append(gitArgs, args...)
32
33 err = syscall.Exec(git, gitArgs, []string{})
34 if err != nil {
35 s.fatalf("could not run git: %v", err)
36 }
37}

Callers 1

mainFunction · 0.95

Calls 2

fatalfMethod · 0.95
projectOrDieMethod · 0.95

Tested by

no test coverage detected