[OCaml] Mobile-friendly clone of cgit.
Add all_branches function sketch.
lib/git_helpers.ml
@@ -62,5 +62,16 @@
62
62
end
63
63
64
64
module Branch = struct
65
Removed:
let all_branches repo_path = [ "foo"; "bar"; repo_path ]
65
Added:
type t = { name : string }
66
Added:
67
Added:
let all_branches repo_path =
68
Added:
let open Lwt_result.Syntax in
69
Added:
let* store = Git_unix.Store.v (Fpath.v repo_path) in
70
Added:
let open Lwt.Syntax in
71
Added:
let* refs = Store.Ref.list store in
72
Added:
let branches =
73
Added:
(* Filter these references for branches! *)
74
Added:
List.map (function _, x -> x |> Store.Hash.to_hex) refs
75
Added:
in
76
Added:
Lwt_result.return branches
66
77
end