aboutsummaryrefslogtreecommitdiffstats
path: root/bug/bug.go
diff options
context:
space:
mode:
Diffstat (limited to 'bug/bug.go')
-rw-r--r--bug/bug.go4
1 files changed, 3 insertions, 1 deletions
diff --git a/bug/bug.go b/bug/bug.go
index 398bdb9f..88a0ff8b 100644
--- a/bug/bug.go
+++ b/bug/bug.go
@@ -14,6 +14,7 @@ const BugsRefPattern = "refs/bugs/"
const BugsRemoteRefPattern = "refs/remote/%s/bugs/"
const OpsEntryName = "ops"
const RootEntryName = "root"
+const HumanIdLength = 7
// Bug hold the data of a bug thread, organized in a way close to
// how it will be persisted inside Git. This is the datastructure
@@ -347,7 +348,8 @@ func (bug *Bug) Id() string {
// Return the Bug identifier truncated for human consumption
func (bug *Bug) HumanId() string {
- return fmt.Sprintf("%.8s", bug.id)
+ format := fmt.Sprintf("%%.%ds", HumanIdLength)
+ return fmt.Sprintf(format, bug.id)
}
// Lookup for the very first operation of the bug.