diff --git a/cmd/abra/main.go b/cmd/abra/main.go index d31d1e82..514583ad 100644 --- a/cmd/abra/main.go +++ b/cmd/abra/main.go @@ -16,7 +16,7 @@ func main() { Version = "dev" } if Commit == "" { - Commit = " " + Commit = "unknown-commit" } cli.Run(Version, Commit) diff --git a/pkg/formatter/formatter.go b/pkg/formatter/formatter.go index 1ffca2f7..ab5f0f39 100644 --- a/pkg/formatter/formatter.go +++ b/pkg/formatter/formatter.go @@ -27,10 +27,16 @@ var BoldUnderlineStyle = lipgloss.NewStyle(). Underline(true) func ShortenID(str string) string { + if len(str) < 12 { + return str + } return str[:12] } func SmallSHA(hash string) string { + if len(hash) < 8 { + return hash + } return hash[:8] }