MCPcopy Index your code
hub / github.com/rilldata/rill / RunGitFetch

Function RunGitFetch

cli/pkg/gitutil/gitcmdwrapper.go:91–107  ·  view source on GitHub ↗
(ctx context.Context, path, remote string)

Source from the content-addressed store, hash-verified

89}
90
91func RunGitFetch(ctx context.Context, path, remote string) error {
92 args := []string{"-C", path, "fetch"}
93 if remote != "" {
94 // if remote is specified, fetch from that remote
95 args = append(args, remote)
96 }
97 cmd := exec.CommandContext(ctx, "git", args...)
98 _, err := cmd.Output()
99 if err != nil {
100 var execErr *exec.ExitError
101 if errors.As(err, &execErr) {
102 return fmt.Errorf("git fetch failed: %s", string(execErr.Stderr))
103 }
104 return err
105 }
106 return nil
107}
108
109// RunGitPull runs a git pull command in the specified path.
110func RunGitPull(ctx context.Context, path string, discardLocal bool, remote, remoteName string) (string, error) {

Callers 1

GitFetchFunction · 0.85

Calls 1

ErrorfMethod · 0.65

Tested by

no test coverage detected