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

Function ShortSHA

git/client.go:810–815  ·  view source on GitHub ↗

ShortSHA returns the first 8 characters of a SHA hash for display purposes.

(sha string)

Source from the content-addressed store, hash-verified

808
809// ShortSHA returns the first 8 characters of a SHA hash for display purposes.
810func ShortSHA(sha string) string {
811 if len(sha) > 8 {
812 return sha[:8]
813 }
814 return sha
815}
816
817func (c *Client) UnsetRemoteResolution(ctx context.Context, name string) error {
818 args := []string{"config", "--unset", fmt.Sprintf("remote.%s.gh-resolved", name)}

Callers 3

updateRunFunction · 0.92
resolveVersionFunction · 0.92
TestShortSHAFunction · 0.85

Calls

no outgoing calls

Tested by 1

TestShortSHAFunction · 0.68