[OCaml] Mobile-friendly clone of cgit.
refactor Remove unused dispatch helpers
handle, handle_request, and handle_id had no callers; routes uses with_repository directly.
Changed files
lib/handlers.ml
@@ -142,16 +142,6 @@
142
142
(fun () -> continue repository context)
143
143
(fun () -> Resolvers.close_repository repository)
144
144
145
Removed:
let handle config handler _request name = with_repository config name handler
146
Removed:
147
Removed:
let handle_request config handler request name =
148
Removed:
with_repository config name (fun repository context ->
149
Removed:
handler request repository context)
150
Removed:
151
Removed:
let handle_id config handler _request name id =
152
Removed:
with_repository config name (fun repository context ->
153
Removed:
handler repository context id)
154
Removed:
155
145
let summary _config repository context =
156
146
let* readme = Resolvers.Repo.readme repository in
157
147
Views.Repo.summary context ?readme ()
lib/handlers.mli
@@ -26,37 +26,6 @@
26
26
Dream.response Dream.promise
27
27
(** Open a repository by name, build a view context, run the continuation,
28
28
then close the repository. Renders an error page on failure. *)
29
Removed:
30
Removed:
val handle :
31
Removed:
Config.t ->
32
Removed:
(Resolvers.repository -> Repo.context -> Dream.response Dream.promise) ->
33
Removed:
Dream.request ->
34
Removed:
string ->
35
Removed:
Dream.response Dream.promise
36
Removed:
(** Dispatch a handler that needs repository and context. *)
37
Removed:
38
Removed:
val handle_request :
39
Removed:
Config.t ->
40
Removed:
(Dream.request ->
41
Removed:
Resolvers.repository ->
42
Removed:
Repo.context ->
43
Removed:
Dream.response Dream.promise) ->
44
Removed:
Dream.request ->
45
Removed:
string ->
46
Removed:
Dream.response Dream.promise
47
Removed:
(** Dispatch a handler that additionally needs the request. *)
48
Removed:
49
Removed:
val handle_id :
50
Removed:
Config.t ->
51
Removed:
(Resolvers.repository ->
52
Removed:
Repo.context ->
53
Removed:
string ->
54
Removed:
Dream.response Dream.promise) ->
55
Removed:
Dream.request ->
56
Removed:
string ->
57
Removed:
string ->
58
Removed:
Dream.response Dream.promise
59
Removed:
(** Dispatch a handler that resolves an object by identifier. *)
60
29
end
61
30
62
31
val routes : Config.t -> Dream.route list