Monorepo management for opam overlays
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

fix(monopam): selective cache repair and clean checkouts before push

- Replace full cache clear with selective removal of bad entries, so
valid split commits are preserved and the chain stays connected to
checkout history
- Clean untracked files in checkouts before pushing to prevent
"working tree file would be overwritten" errors with updateInstead

+15
+4
lib/git_cli.ml
··· 159 159 [ "config"; "receive.denyCurrentBranch"; "updateInstead" ] 160 160 |> Result.map ignore 161 161 162 + let clean_untracked ~proc ~fs path = 163 + let cwd = path_to_eio ~fs path in 164 + run_git_ok ~proc ~cwd [ "clean"; "-fd" ] |> Result.map ignore 165 + 162 166 let fetch ~proc ~fs ?(remote = "origin") path = 163 167 let cwd = path_to_eio ~fs path in 164 168 run_git_ok_with_retry ~proc ~cwd [ "fetch"; remote ] |> Result.map ignore
+8
lib/git_cli.mli
··· 57 57 [receive.denyCurrentBranch=updateInstead] on the repo at [path], allowing 58 58 pushes to its checked-out branch. *) 59 59 60 + val clean_untracked : 61 + proc:_ Eio.Process.mgr -> 62 + fs:Eio.Fs.dir_ty Eio.Path.t -> 63 + Fpath.t -> 64 + (unit, error) result 65 + (** [clean_untracked ~proc ~fs path] removes untracked files and directories 66 + from the working tree at [path]. *) 67 + 60 68 val fetch : 61 69 proc:_ Eio.Process.mgr -> 62 70 fs:Eio.Fs.dir_ty Eio.Path.t ->
+3
lib/push.ml
··· 108 108 ~fs:(fs :> _ Eio.Path.t) 109 109 checkout_dir 110 110 in 111 + let* () = 112 + Git_cli.clean_untracked ~proc ~fs:(fs :> _ Eio.Path.t) checkout_dir 113 + in 111 114 split_and_push ~proc ~fs ~monorepo ~git_repo ~prefix ~checkout_url ~clean 112 115 ~force ~branch 113 116 |> Result.map (fun () -> true)