Monorepo for Tangled
0

Configure Feed

Select the types of activity you want to include in your feed.

knotserver/git: access object directly with hash, more shorter timeout

Signed-off-by: Seongmin Lee <git@boltless.me>

author
Seongmin Lee
committer
Tangled
date (May 12, 2026, 11:47 AM +0300) commit 86443f69 parent 9acac4bf change-id uzuzkwxw
+6 -2
+6 -2
knotserver/git/tree.go
··· 58 58 entries: entries, 59 59 } 60 60 61 - times, err := g.lastCommitDirIn(ctx, lastCommitDir, 500*time.Millisecond) 61 + times, err := g.lastCommitDirIn(ctx, lastCommitDir, 300*time.Millisecond) 62 62 if err != nil { 63 63 return nts 64 64 } 65 65 66 66 for _, e := range subtree.Entries { 67 - sz, _ := subtree.Size(e.Name) 67 + var sz int64 68 + blob, err := object.GetBlob(g.r.Storer, e.Hash) 69 + if err == nil { 70 + sz = blob.Size 71 + } 68 72 fpath := path.Join(parent, e.Name) 69 73 70 74 var lastCommit *types.LastCommitInfo