Monorepo for Tangled tangled.org

knotserver/internal: fix repo compare URL #658

Before this we incorrectly assumed that the git user Did was the same as the repo Did, this is not the case. We now take the repo Did as an argument to the replyCompare function

Signed-off-by: Samuel Shuert me@thecoded.prof

Labels

None yet.

assignee

None yet.

Participants 2
AT URI
at://did:plc:k2zmz2l3hvfr44tmlhewol2j/sh.tangled.repo.pull/3m2wvv63a5l22
+4 -4
Diff #0
+4 -4
knotserver/internal.go
··· 121 } 122 123 if (line.NewSha.String() != line.OldSha.String()) && line.OldSha.IsZero() { 124 - msg, err := h.replyCompare(line, gitUserDid, gitRelativeDir, repoName, r.Context()) 125 if err != nil { 126 l.Error("failed to reply with compare link", "err", err, "line", line, "did", gitUserDid, "repo", gitRelativeDir) 127 // non-fatal ··· 142 writeJSON(w, resp) 143 } 144 145 - func (h *InternalHandle) replyCompare(line git.PostReceiveLine, gitUserDid string, gitRelativeDir string, repoName string, ctx context.Context) ([]string, error) { 146 l := h.l.With("handler", "replyCompare") 147 - userIdent, err := idresolver.DefaultResolver().ResolveIdent(ctx, gitUserDid) 148 - user := gitUserDid 149 if err != nil { 150 l.Error("Failed to fetch user identity", "err", err) 151 // non-fatal
··· 121 } 122 123 if (line.NewSha.String() != line.OldSha.String()) && line.OldSha.IsZero() { 124 + msg, err := h.replyCompare(line, repoDid, gitRelativeDir, repoName, r.Context()) 125 if err != nil { 126 l.Error("failed to reply with compare link", "err", err, "line", line, "did", gitUserDid, "repo", gitRelativeDir) 127 // non-fatal ··· 142 writeJSON(w, resp) 143 } 144 145 + func (h *InternalHandle) replyCompare(line git.PostReceiveLine, repoOwner string, gitRelativeDir string, repoName string, ctx context.Context) ([]string, error) { 146 l := h.l.With("handler", "replyCompare") 147 + userIdent, err := idresolver.DefaultResolver().ResolveIdent(ctx, repoOwner) 148 + user := repoOwner 149 if err != nil { 150 l.Error("Failed to fetch user identity", "err", err) 151 // non-fatal

History

1 round 1 comment
sign up or login to add to the discussion
1 commit
expand
knotserver/internal: fix repo compare URL
expand 1 comment

lgtm thanks!

pull request successfully merged