Skip to content

Commit 6824825

Browse files
committed
copy files preserving attributes
on Windows this avoids Git detecting the files as modified
1 parent f682e5b commit 6824825

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

opengrok-indexer/src/test/java/org/opengrok/indexer/util/TestRepository.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@
3939
import org.jetbrains.annotations.NotNull;
4040
import org.opengrok.indexer.configuration.RuntimeEnvironment;
4141

42+
import static java.nio.file.StandardCopyOption.COPY_ATTRIBUTES;
4243
import static java.nio.file.StandardCopyOption.REPLACE_EXISTING;
4344
import static org.junit.jupiter.api.Assertions.assertFalse;
4445
import static org.junit.jupiter.api.Assertions.assertNotNull;
@@ -111,7 +112,8 @@ public void copyDirectory(Path src, Path dest) throws IOException {
111112
}
112113
try {
113114
Path destRelativePath = getDestinationRelativePath(src, sourceFile);
114-
Files.copy(sourceFile, dest.resolve(destRelativePath.toString()), REPLACE_EXISTING);
115+
Files.copy(sourceFile, dest.resolve(destRelativePath.toString()),
116+
REPLACE_EXISTING, COPY_ATTRIBUTES);
115117
} catch (Exception e) {
116118
throw new RuntimeException(e);
117119
}

0 commit comments

Comments
 (0)