Monorepo management for opam overlays

Skip verse fetch for packages without checkouts

Similar to the merge step fix, fetch_verse_remotes was calling
Git.list_remotes without checking if the checkout exists first.

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

+13 -8
+13 -8
lib/monopam.ml
··· 1221 1221 let fetch_verse_remotes ~proc ~fs ~config pkg = 1222 1222 let checkouts_root = Config.Paths.checkouts config in 1223 1223 let checkout_dir = Package.checkout_dir ~checkouts_root pkg in 1224 - let remotes = Git.list_remotes ~proc ~fs checkout_dir in 1225 - let verse_remotes = List.filter (fun r -> String.starts_with ~prefix:"verse-" r) remotes in 1226 - List.iter (fun remote -> 1227 - Log.debug (fun m -> m "Fetching from verse remote %s" remote); 1228 - match Git.fetch ~proc ~fs ~remote checkout_dir with 1229 - | Ok () -> () 1230 - | Error e -> Log.debug (fun m -> m "Failed to fetch from %s: %a" remote Git.pp_error e)) 1231 - verse_remotes 1224 + (* Skip packages without checkouts *) 1225 + if not (Git.is_repo ~proc ~fs checkout_dir) then 1226 + Log.info (fun m -> m "Skipping verse fetch for %s (no checkout)" (Package.repo_name pkg)) 1227 + else begin 1228 + let remotes = Git.list_remotes ~proc ~fs checkout_dir in 1229 + let verse_remotes = List.filter (fun r -> String.starts_with ~prefix:"verse-" r) remotes in 1230 + List.iter (fun remote -> 1231 + Log.debug (fun m -> m "Fetching from verse remote %s" remote); 1232 + match Git.fetch ~proc ~fs ~remote checkout_dir with 1233 + | Ok () -> () 1234 + | Error e -> Log.debug (fun m -> m "Failed to fetch from %s: %a" remote Git.pp_error e)) 1235 + verse_remotes 1236 + end 1232 1237 1233 1238 let sync ~proc ~fs ~config ?package ?(remote = false) ?(skip_push = false) ?(skip_pull = false) () = 1234 1239 let fs_t = fs_typed fs in