MCPcopy Create free account
hub / github.com/antonmedv/gitmal / CommitDiff

Function CommitDiff

pkg/git/git.go:342–353  ·  view source on GitHub ↗
(hash, repoDir string)

Source from the content-addressed store, hash-verified

340}
341
342func CommitDiff(hash, repoDir string) (string, error) {
343 // unified diff without a commit header
344 cmd := exec.Command("git", "show", "--pretty=format:", "--patch", hash)
345 if repoDir != "" {
346 cmd.Dir = repoDir
347 }
348 out, err := cmd.Output()
349 if err != nil {
350 return "", err
351 }
352 return string(out), nil
353}

Callers 1

generateCommitPageFunction · 0.92

Calls

no outgoing calls

Tested by

no test coverage detected