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