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

Function ShortSHA

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

810
811// ShortSHA returns the first 8 characters of a SHA hash for display purposes.
812func ShortSHA(sha string) string {
813 if len(sha) > 8 {
814 return sha[:8]
815 }
816 return sha
817}
818
819func (c *Client) UnsetRemoteResolution(ctx context.Context, name string) error {
820 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