(oid string)
| 73 | } |
| 74 | |
| 75 | func (f *Filesystem) ObjectPath(oid string) (string, error) { |
| 76 | if len(oid) < 4 { |
| 77 | return "", errors.New(tr.Tr.Get("too short object ID: %q", oid)) |
| 78 | } |
| 79 | if oid == EmptyObjectSHA256 { |
| 80 | return os.DevNull, nil |
| 81 | } |
| 82 | dir := f.localObjectDir(oid) |
| 83 | if err := tools.MkdirAll(dir, f); err != nil { |
| 84 | return "", errors.New(tr.Tr.Get("error trying to create local storage directory in %q: %s", dir, err)) |
| 85 | } |
| 86 | return filepath.Join(dir, oid), nil |
| 87 | } |
| 88 | |
| 89 | func (f *Filesystem) ObjectPathname(oid string) string { |
| 90 | if oid == EmptyObjectSHA256 { |
no test coverage detected