Monorepo management for opam overlays
0
fork

Configure Feed

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

Always force-push to local checkouts; --force only affects upstream

Local checkouts (../src/) are derived caches, not independent repos.
The push from monorepo to local checkout should always succeed — the
monorepo is authoritative. The --force CLI flag now only controls
whether upstream remote pushes are forced.

This fixes push failures after split algorithm changes or filter-repo
without requiring manual --force.

+5 -2
+5 -2
lib/push.ml
··· 19 19 | _ -> None) 20 20 21 21 let split_and_push ~proc ~fs ~monorepo ~git_repo ~prefix ~checkout_url ~clean 22 - ~force ~branch = 22 + ~force:_ ~branch = 23 23 match Git.Repository.read_ref git_repo "HEAD" with 24 24 | None -> Error (Ctx.Git_error (Git_cli.Io_error "no HEAD ref found")) 25 25 | Some head -> ( ··· 39 39 split_hash) 40 40 else split_hash 41 41 in 42 + (* Always force-push to local checkouts. They are derived caches, 43 + not independent repos. The --force CLI flag controls upstream 44 + remote pushes, not local checkout updates. *) 42 45 let refspec = Git.Hash.to_hex final_hash ^ ":refs/heads/" ^ branch in 43 46 match 44 47 Git_cli.push_refspec ~proc ~fs ~repo:monorepo ~url:checkout_url 45 - ~refspec ~force:(clean || force) () 48 + ~refspec ~force:true () 46 49 with 47 50 | Ok () -> Ok () 48 51 | Error e -> Error (Ctx.Git_error e)))