forked from tangled.org/core
Monorepo for Tangled — https://tangled.org

appview/pulls: handle deleted forks in branch status check

Signed-off-by: oppiliappan <me@oppi.li>

oppi.li 779b15d2 62a3b473

verified
Changed files
+5
appview
pulls
+5
appview/pulls/pulls.go
···
return nil
}
+
// deleted fork
+
if repo == nil {
+
return nil
+
}
+
// user can only delete branch if they are a collaborator in the repo that the branch belongs to
perms := s.enforcer.GetPermissionsInRepo(user.Did, repo.Knot, repo.DidSlashRepo())
if !slices.Contains(perms, "repo:push") {