MCPcopy Create free account
hub / github.com/cli/cli / lookupCommit

Method lookupCommit

git/client.go:428–439  ·  view source on GitHub ↗
(ctx context.Context, sha, format string)

Source from the content-addressed store, hash-verified

426}
427
428func (c *Client) lookupCommit(ctx context.Context, sha, format string) ([]byte, error) {
429 args := []string{"-c", "log.ShowSignature=false", "show", "-s", "--pretty=format:" + format, sha}
430 cmd, err := c.Command(ctx, args...)
431 if err != nil {
432 return nil, err
433 }
434 out, err := cmd.Output()
435 if err != nil {
436 return nil, err
437 }
438 return out, nil
439}
440
441// ReadBranchConfig parses the `branch.BRANCH.(remote|merge|pushremote|gh-merge-base)` part of git config.
442// If no branch config is found or there is an error in the command, it returns an empty BranchConfig.

Callers 2

LastCommitMethod · 0.95
CommitBodyMethod · 0.95

Calls 2

CommandMethod · 0.95
OutputMethod · 0.65

Tested by

no test coverage detected