2 files changed,
11 insertions(+),
1 deletions(-)
Author:
Oleksandr Smirnov
olexsmir@gmail.com
Committed at:
2026-02-06 20:55:59 +0200
Authored at:
2026-02-05 23:38:37 +0200
Change ID:
zwvsnvxorvrtxnxmvzsoqvxuskovkwvy
Parent:
ebd4bbe
jump to
| M | internal/git/repo.go |
| M | internal/handlers/repo.go |
M
internal/git/repo.go
路路路 15 15 16 16 // Thanks https://git.icyphox.sh/legit/blob/master/git/git.go 17 17 18 -var ErrEmptyRepo = errors.New("repository has no commits") 18 +var ( 19 + ErrEmptyRepo = errors.New("repository has no commits") 20 + ErrFileNotFound = errors.New("file not found") 21 +) 19 22 20 23 type Repo struct { 21 24 path string 路路路 138 141 139 142 file, err := tree.File(path) 140 143 if err != nil { 144 + if errors.Is(err, object.ErrFileNotFound) { 145 + return "", ErrFileNotFound 146 + } 141 147 return "", err 142 148 } 143 149