Skip to main content

copy_index_with_timestamps

Function copy_index_with_timestamps 

Source
pub fn copy_index_with_timestamps(
    source: &Path,
    destination: &Path,
) -> Result<()>
Expand description

What: Copies an index and gives the copy the source’s access and modification times. Why: A copy with fresh times would make Git trust stat data captured in the same second as a later same-size edit (issue #544). A missing source is an error, as the incumbent’s copyFile reports it.

In TS you’d write (pseudocode):

await copyIndexFile({ sourcePath, destinationPath });