MCPcopy Create free account
hub / github.com/github/gh-aw / shortRef

Function shortRef

pkg/cli/update_workflows.go:840–845  ·  view source on GitHub ↗

shortRef abbreviates a ref for display. Commit SHAs are truncated to 7 characters; other refs (branch names, tags) are returned as-is.

(ref string)

Source from the content-addressed store, hash-verified

838// shortRef abbreviates a ref for display. Commit SHAs are truncated to 7 characters;
839// other refs (branch names, tags) are returned as-is.
840func shortRef(ref string) string {
841 if IsCommitSHA(ref) {
842 return ref[:7]
843 }
844 return ref
845}

Callers 5

resolveVersionLabelFunction · 0.85
TestShortRefFunction · 0.85
updateWorkflowFunction · 0.85

Calls 1

IsCommitSHAFunction · 0.85

Tested by 2

TestShortRefFunction · 0.68