Add all_branches function sketch.

Commit
e457b7a8702ae3672cb65d8b3d394dd112594a89
Author
Marius Peter <marius.peter@tutanota.com>
Author date
Committer
Marius Peter <marius.peter@tutanota.com>
Committer date
lib/git_helpers.ml
index 845ee6bf..317398cd 100644..100644
@@ -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