MCPcopy Index your code
hub / github.com/cli/cli / lookupCommit

Method lookupCommit

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

Source from the content-addressed store, hash-verified

364}
365
366func (c *Client) lookupCommit(ctx context.Context, sha, format string) ([]byte, error) {
367 args := []string{"-c", "log.ShowSignature=false", "show", "-s", "--pretty=format:" + format, sha}
368 cmd, err := c.Command(ctx, args...)
369 if err != nil {
370 return nil, err
371 }
372 out, err := cmd.Output()
373 if err != nil {
374 return nil, err
375 }
376 return out, nil
377}
378
379// ReadBranchConfig parses the `branch.BRANCH.(remote|merge|pushremote|gh-merge-base)` part of git config.
380// 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