forgejo-aneksajo_auto_patch.../data/44/patched.diff
2025-01-23 01:26:39 +01:00

23 lines
754 B
Diff

11a12
> "code.gitea.io/gitea/modules/annex"
80a82,101
>
> // check for git-annex files
> // (this code is weirdly redundant because I'm trying not to delete any lines in order to make merges easier)
> isAnnexed, err := annex.IsAnnexed(blob)
> if err != nil {
> ctx.ServerError("annex.IsAnnexed", err)
> return err
> }
> if isAnnexed {
> content, err := annex.Content(blob)
> if err != nil {
> // XXX are there any other possible failure cases here?
> // there are, there could be unrelated io errors; those should be ctx.ServerError()s
> ctx.NotFound("annex.Content", err)
> return err
> }
> defer content.Close()
> common.ServeContentByReadSeeker(ctx.Base, ctx.Repo.TreePath, lastModified, content)
> return nil
> }