Select the types of activity you want to include in your feed.
Port add_all, commit, rm from Git_cli to ocaml-git
- Update fork_join.ml and monopam.ml to use Git.Repository - Remove add_all, commit, rm from Git_cli - Add 14 tests for add_all, commit, rm - Simplify test code using unwrap helper
···207207 @param ref_name The ref to merge (e.g., "verse/handle/main")
208208 @param ff_only If true, only allow fast-forward merges (default: false)
209209 @param path Path to the repository *)
210210-211211-val add_all :
212212- proc:_ Eio.Process.mgr ->
213213- fs:Eio.Fs.dir_ty Eio.Path.t ->
214214- Fpath.t ->
215215- (unit, error) result
216216-(** [add_all ~proc ~fs path] stages all changes (git add -A) in the repository
217217- at [path]. *)
218218-219219-val commit :
220220- proc:_ Eio.Process.mgr ->
221221- fs:Eio.Fs.dir_ty Eio.Path.t ->
222222- message:string ->
223223- Fpath.t ->
224224- (unit, error) result
225225-(** [commit ~proc ~fs ~message path] creates a commit with the given message in
226226- the repository at [path]. *)
227227-228228-val rm :
229229- proc:_ Eio.Process.mgr ->
230230- fs:Eio.Fs.dir_ty Eio.Path.t ->
231231- recursive:bool ->
232232- Fpath.t ->
233233- string ->
234234- (unit, error) result
235235-(** [rm ~proc ~fs ~recursive path target] removes [target] from the git index in
236236- the repository at [path]. If [recursive] is true, removes directories
237237- recursively (git rm -r). *)
+10-14
lib/monopam.ml
···15891589 Log.info (fun m ->
15901590 m "Regenerated %d opam-repo entries from monorepo" !updated);
15911591 if commit && Git.Repository.is_repo ~fs opam_repo then
15921592- match Git_cli.add_all ~proc ~fs opam_repo with
15931593- | Error e ->
15941594- Log.warn (fun m ->
15951595- m "Failed to stage opam-repo: %a" Git_cli.pp_error e)
15921592+ let repo = Git.Repository.open_repo ~fs opam_repo in
15931593+ match Git.Repository.add_all repo with
15941594+ | Error (`Msg e) ->
15951595+ Log.warn (fun m -> m "Failed to stage opam-repo: %s" e)
15961596 | Ok () -> (
15971597 match
15981598- Git_cli.commit ~proc ~fs opam_repo
15981598+ Git.Repository.commit repo
15991599 ~message:"Update opam files from monorepo"
16001600 with
16011601- | Error (Git_cli.Command_failed (_, result))
16021602- when String.starts_with ~prefix:"nothing to commit"
16031603- result.Git_cli.stdout
16041604- || String.starts_with ~prefix:"nothing to commit"
16051605- result.Git_cli.stderr ->
16011601+ | Error (`Msg msg)
16021602+ when String.starts_with ~prefix:"nothing to commit" msg ->
16061603 ()
16071607- | Error e ->
16081608- Log.warn (fun m ->
16091609- m "Failed to commit opam-repo: %a" Git_cli.pp_error e)
16101610- | Ok () -> Log.info (fun m -> m "Committed opam-repo changes"))
16041604+ | Error (`Msg e) ->
16051605+ Log.warn (fun m -> m "Failed to commit opam-repo: %s" e)
16061606+ | Ok _ -> Log.info (fun m -> m "Committed opam-repo changes"))
16111607 end
1612160816131609(** Clone monorepo and opam-repo from verse registry if they don't exist