The unpac monorepo manager self-hosting as a monorepo using unpac
0
fork

Configure Feed

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

Eliminate code duplication

+4 -18
+4 -18
utils/load_path.ml
··· 201 201 type visibility = Visible | Hidden 202 202 203 203 let find_file_in_cache fn visible_files hidden_files = 204 - try STbl.find !visible_files fn with 205 - | Not_found -> STbl.find !hidden_files fn 206 - 207 - let find_file_in_cache_with_visibility fn visible_files hidden_files = 208 204 try (STbl.find !visible_files fn, Visible) with 209 205 | Not_found -> (STbl.find !hidden_files fn, Hidden) 210 206 ··· 212 208 assert (not Config.merlin || Local_store.is_bound ()); 213 209 try 214 210 if is_basename fn && not !Sys.interactive then 215 - find_file_in_cache fn visible_files hidden_files 211 + fst (find_file_in_cache fn visible_files hidden_files) 216 212 else 217 213 Misc.find_in_path (get_path_list ()) fn 218 214 with Not_found -> 219 215 !auto_include_callback Dir.find fn 220 216 221 - let find_normalized fn = 222 - assert (not Config.merlin || Local_store.is_bound ()); 223 - try 224 - if is_basename fn && not !Sys.interactive then 225 - find_file_in_cache (Misc.normalized_unit_filename fn) visible_files_uncap 226 - hidden_files_uncap 227 - else 228 - Misc.find_in_path_normalized (get_path_list ()) fn 229 - with Not_found -> 230 - let fn_uncap = Misc.normalized_unit_filename fn in 231 - !auto_include_callback Dir.find_normalized fn_uncap 232 - 233 217 let find_normalized_with_visibility fn = 234 218 assert (not Config.merlin || Local_store.is_bound ()); 235 219 try 236 220 if is_basename fn && not !Sys.interactive then 237 - find_file_in_cache_with_visibility (Misc.normalized_unit_filename fn) 221 + find_file_in_cache (Misc.normalized_unit_filename fn) 238 222 visible_files_uncap hidden_files_uncap 239 223 else 240 224 try ··· 245 229 with Not_found -> 246 230 let fn_uncap = Misc.normalized_unit_filename fn in 247 231 (!auto_include_callback Dir.find_normalized fn_uncap, Visible) 232 + 233 + let find_normalized fn = fst (find_normalized_with_visibility fn)