MCPcopy Index your code
hub / github.com/jetify-com/devbox / shortRev

Function shortRev

internal/devbox/update.go:277–286  ·  view source on GitHub ↗

shortRev returns the first 7 chars of the locked git rev, or "" for refs without one (path:, tarball:, unlocked refs).

(resolved string)

Source from the content-addressed store, hash-verified

275// shortRev returns the first 7 chars of the locked git rev, or "" for refs
276// without one (path:, tarball:, unlocked refs).
277func shortRev(resolved string) string {
278 installable, err := flake.ParseInstallable(resolved)
279 if err != nil || installable.Ref.Rev == "" {
280 return ""
281 }
282 if len(installable.Ref.Rev) < 7 {
283 return installable.Ref.Rev
284 }
285 return installable.Ref.Rev[:7]
286}
287
288func shortDate(rfc3339 string) string {
289 if rfc3339 == "" {

Callers 2

describeFlakeUpdateFunction · 0.85
TestShortRevFunction · 0.85

Calls 1

ParseInstallableFunction · 0.92

Tested by 1

TestShortRevFunction · 0.68