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

Function ShortSHA

git/client.go:750–755  ·  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

748
749// ShortSHA returns the first 8 characters of a SHA hash for display purposes.
750func ShortSHA(sha string) string {
751 if len(sha) > 8 {
752 return sha[:8]
753 }
754 return sha
755}
756
757func (c *Client) UnsetRemoteResolution(ctx context.Context, name string) error {
758 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