File tree Expand file tree Collapse file tree 1 file changed +4
-1
lines changed
opengrok-indexer/src/test/java/org/opengrok/indexer/index Expand file tree Collapse file tree 1 file changed +4
-1
lines changed Original file line number Diff line number Diff line change @@ -116,10 +116,13 @@ public void setUpClass() throws Exception {
116
116
// To avoid this, clone the Git repository.
117
117
Path gitRepositoryRootPath = Path .of (repository .getSourceRoot (), "git" );
118
118
Path gitCheckoutPath = Path .of (repository .getSourceRoot (), "gitcheckout" );
119
- Git .cloneRepository ()
119
+ Git git = Git .cloneRepository ()
120
120
.setURI (gitRepositoryRootPath .toFile ().toURI ().toString ())
121
121
.setDirectory (gitCheckoutPath .toFile ())
122
122
.call ();
123
+ // The Git object has to be closed, otherwise the move below would fail on Windows with
124
+ // AccessDeniedException due to the file handle still being open.
125
+ git .close ();
123
126
IOUtils .removeRecursive (gitRepositoryRootPath );
124
127
Files .move (gitCheckoutPath , gitRepositoryRootPath );
125
128
You can’t perform that action at this time.
0 commit comments