MCPcopy Create free account
hub / github.com/MiniCodeMonkey/chief / GetDiffForCommit

Function GetDiffForCommit

internal/git/git.go:129–137  ·  view source on GitHub ↗

GetDiffForCommit returns the diff for a single commit using git show.

(dir, commitHash string)

Source from the content-addressed store, hash-verified

127
128// GetDiffForCommit returns the diff for a single commit using git show.
129func GetDiffForCommit(dir, commitHash string) (string, error) {
130 cmd := exec.Command("git", "show", "--format=", commitHash)
131 cmd.Dir = dir
132 output, err := cmd.Output()
133 if err != nil {
134 return "", err
135 }
136 return string(output), nil
137}
138
139// GetDiffStatsForCommit returns the diffstat for a single commit.
140func GetDiffStatsForCommit(dir, commitHash string) (string, error) {

Callers 1

loadDiffMethod · 0.92

Calls

no outgoing calls

Tested by

no test coverage detected