mirror of https://github.com/perkeep/perkeep.git
go blobserver: fix crash if short blobrefs requested.
This commit is contained in:
parent
66e6831b9d
commit
adf13c6123
|
@ -52,6 +52,9 @@ func BlobFileBaseName(b *blobref.BlobRef) string {
|
|||
|
||||
func BlobDirectoryName(b *blobref.BlobRef) string {
|
||||
d := b.Digest()
|
||||
if len(d) < 6 {
|
||||
d = d + "______"
|
||||
}
|
||||
return fmt.Sprintf("%s/%s/%s/%s", *flagStorageRoot, b.HashName(), d[0:3], d[3:6])
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue