File tree Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -236,8 +236,14 @@ struct
236236 (* temporary workaround for dir-to-empty-target-dir https://github.com/ocaml/ocaml/issues/12073 *)
237237 if Sys. win32 && path_is_an_empty_dir fs new_path then fs else
238238 (* temporary workaround for dir-to-file https://github.com/ocaml/ocaml/issues/12073 *)
239- if (Sys. win32 && path_is_an_empty_dir fs new_path) ||
240- (not (Model. mem fs new_path) || path_is_an_empty_dir fs new_path) then Model. rename fs old_path new_path else fs)
239+ if (Sys. win32 && path_is_file fs new_path) then
240+ (match Model. separate_path new_path in
241+ | None -> fs
242+ | Some (new_path_pref , new_name ) ->
243+ let fs = remove fs new_path_pref new_name in
244+ Model. rename fs old_path new_path)
245+ else
246+ if (not (Model. mem fs new_path) || path_is_an_empty_dir fs new_path) then Model. rename fs old_path new_path else fs)
241247 | Is_directory _path -> fs
242248 | Rmdir (path ,delete_dir_name ) ->
243249 let complete_path = path @ [delete_dir_name] in
You can’t perform that action at this time.
0 commit comments