File tree Expand file tree Collapse file tree 1 file changed +12
-0
lines changed
opengrok-indexer/src/test/java/org/opengrok/indexer/index Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -111,6 +111,18 @@ public void setUpClass() throws Exception {
111
111
repository = new TestRepository ();
112
112
repository .create (HistoryGuru .class .getResource ("/repositories" ));
113
113
114
+ // After copying the files from the archive, Git will consider the files to be changed,
115
+ // at least on Windows. This causes some tests, particularly testGetIndexDownArgs() to fail.
116
+ // To avoid this, clone the Git repository.
117
+ Path gitRepositoryRootPath = Path .of (repository .getSourceRoot (), "git" );
118
+ Path gitCheckoutPath = Path .of (repository .getSourceRoot (), "gitcheckout" );
119
+ Git .cloneRepository ()
120
+ .setURI (gitRepositoryRootPath .toFile ().toURI ().toString ())
121
+ .setDirectory (gitCheckoutPath .toFile ())
122
+ .call ();
123
+ IOUtils .removeRecursive (gitRepositoryRootPath );
124
+ Files .move (gitCheckoutPath , gitRepositoryRootPath );
125
+
114
126
env .setSourceRoot (repository .getSourceRoot ());
115
127
env .setDataRoot (repository .getDataRoot ());
116
128
env .setHistoryEnabled (true );
You can’t perform that action at this time.
0 commit comments