Commit bdad985
committed
fix(cp): preserve directory modification times during copy
The mtime was only being applied when currentFile != nil, which is only
true for regular files. For directories, currentFile is never set since
they are created with os.MkdirAll without opening a file handle.
This fix moves the mtime logic outside of the currentFile != nil block
so it applies to both files and directories.1 parent 61f0469 commit bdad985
1 file changed
+9
-9
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
559 | 559 | | |
560 | 560 | | |
561 | 561 | | |
562 | | - | |
563 | | - | |
564 | | - | |
565 | | - | |
566 | | - | |
567 | | - | |
568 | | - | |
569 | | - | |
570 | 562 | | |
571 | | - | |
572 | 563 | | |
| 564 | + | |
| 565 | + | |
| 566 | + | |
| 567 | + | |
| 568 | + | |
| 569 | + | |
| 570 | + | |
| 571 | + | |
| 572 | + | |
573 | 573 | | |
574 | 574 | | |
575 | 575 | | |
| |||
0 commit comments