Monorepo management for opam overlays
0
fork

Configure Feed

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

Configure checkouts to accept pushes to current branch

When pushing from monorepo subtrees to local checkouts, git refuses
to update a checked-out branch by default. This configures checkouts
with receive.denyCurrentBranch=updateInstead, which allows pushes and
automatically updates the working tree.

Applied to both new clones and existing checkouts during sync.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

+22 -2
+22 -2
lib/monopam.ml
··· 1287 1287 match 1288 1288 Git.clone ~proc ~fs ~url:(Package.dev_repo pkg) ~branch checkout_dir 1289 1289 with 1290 - | Ok () -> Ok (true, 0) 1290 + | Ok () -> 1291 + (* Configure checkout to accept pushes to current branch. 1292 + This allows pushing from monorepo subtrees to the checkout. *) 1293 + let cwd = Eio.Path.(fs / Fpath.to_string checkout_dir) in 1294 + Eio.Switch.run (fun sw -> 1295 + let child = 1296 + Eio.Process.spawn proc ~sw ~cwd 1297 + [ "git"; "config"; "receive.denyCurrentBranch"; "updateInstead" ] 1298 + in 1299 + ignore (Eio.Process.await child)); 1300 + Ok (true, 0) 1291 1301 | Error e -> Error e 1292 1302 end 1293 - else Ok (false, 0) 1303 + else begin 1304 + (* Ensure existing checkout is configured to accept pushes *) 1305 + let cwd = Eio.Path.(fs / Fpath.to_string checkout_dir) in 1306 + Eio.Switch.run (fun sw -> 1307 + let child = 1308 + Eio.Process.spawn proc ~sw ~cwd 1309 + [ "git"; "config"; "receive.denyCurrentBranch"; "updateInstead" ] 1310 + in 1311 + ignore (Eio.Process.await child)); 1312 + Ok (false, 0) 1313 + end 1294 1314 1295 1315 (* Fetch a single checkout - safe for parallel execution *) 1296 1316 let fetch_checkout_safe ~proc ~fs ~config pkg =