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

Method lookupCommit

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

Source from the content-addressed store, hash-verified

420}
421
422func (c *Client) lookupCommit(ctx context.Context, sha, format string) ([]byte, error) {
423 args := []string{"-c", "log.ShowSignature=false", "show", "-s", "--pretty=format:" + format, sha}
424 cmd, err := c.Command(ctx, args...)
425 if err != nil {
426 return nil, err
427 }
428 out, err := cmd.Output()
429 if err != nil {
430 return nil, err
431 }
432 return out, nil
433}
434
435// ReadBranchConfig parses the `branch.BRANCH.(remote|merge|pushremote|gh-merge-base)` part of git config.
436// 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