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

Function RunGitPush

cli/pkg/gitutil/gitcmdwrapper.go:182–192  ·  view source on GitHub ↗
(ctx context.Context, path, remoteName, branchName string)

Source from the content-addressed store, hash-verified

180}
181
182func RunGitPush(ctx context.Context, path, remoteName, branchName string) error {
183 cmd := exec.CommandContext(ctx, "git", "-C", path, "push", remoteName, branchName)
184 if out, err := cmd.CombinedOutput(); err != nil {
185 var execErr *exec.ExitError
186 if errors.As(err, &execErr) {
187 return fmt.Errorf("git push failed: %s(%s)", string(out), string(execErr.Stderr))
188 }
189 return fmt.Errorf("git push failed: %s(%w)", string(out), err)
190 }
191 return nil
192}
193
194func InferGitRepoRoot(path string) (string, error) {
195 cmd := exec.Command("git", "-C", path, "rev-parse", "--show-cdup")

Callers 2

CommitAndPushFunction · 0.85

Calls 1

ErrorfMethod · 0.65

Tested by 1