[OCaml] Mobile-friendly clone of cgit.
Harmonize resolvers error messages.
lib/resolvers.ml
@@ -40,7 +40,7 @@
40
40
let hash = Store.Hash.of_hex id in
41
41
Lwt_result.bind (Store.read store hash) @@ function
42
42
| Git.Value.Commit commit -> Lwt_result.return (to_t commit)
43
Removed:
| _ -> Lwt_result.fail @@ `Msg (id ^ " does not point to a commit object")
43
Added:
| _ -> Lwt_result.fail @@ `Msg ("no commit matches id " ^ id)
44
44
45
45
let head repo =
46
46
let* store = store repo in
@@ -89,7 +89,7 @@
89
89
in
90
90
match branch with
91
91
| Some branch -> Lwt_result.return branch
92
Removed:
| None -> Lwt_result.fail @@ `Msg ("Found no branch matching " ^ id)
92
Added:
| None -> Lwt_result.fail @@ `Msg ("no branch matches id " ^ id)
93
93
end
94
94
95
95
module Entry = struct
@@ -122,7 +122,7 @@
122
122
let hash = Store.Hash.of_hex id in
123
123
Lwt_result.bind (Store.read store hash) @@ function
124
124
| Git.Value.Tree tree -> Lwt_result.return (to_t tree)
125
Removed:
| _ -> Lwt_result.fail @@ `Msg ("no tree for id " ^ id)
125
Added:
| _ -> Lwt_result.fail @@ `Msg ("no tree matches id " ^ id)
126
126
127
127
let head repo =
128
128
let* store = store repo in
@@ -144,5 +144,5 @@
144
144
let hash = Store.Hash.of_hex id in
145
145
Lwt_result.bind (Store.read store hash) @@ function
146
146
| Git.Value.Blob blob -> Lwt_result.return (to_t blob)
147
Removed:
| _ -> Lwt_result.fail @@ `Msg (id ^ " does not point to a blob object")
147
Added:
| _ -> Lwt_result.fail @@ `Msg ("no blob matches id " ^ id)
148
148
end