mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-11-09 06:55:47 +01:00
Fix bugs in unit tests which occur on Windows only (#1927)
On Windows it is much more necessary to close files to avoid locked files which prevent deleting a temporary file or folder. Also paths need to be handled differently because of the drive letter and colon appearing on Windows.
This commit is contained in:
committed by
GitHub
parent
63ec4e6172
commit
0f01bb82c6
@@ -45,7 +45,6 @@ import java.util.Collection;
|
||||
|
||||
public abstract class AbstractGitPushOrPullCommand extends AbstractGitCommand {
|
||||
|
||||
private static final String SCHEME = ScmTransportProtocol.NAME + "://";
|
||||
private static final Logger LOG = LoggerFactory.getLogger(AbstractGitPushOrPullCommand.class);
|
||||
|
||||
protected GitRepositoryHandler handler;
|
||||
@@ -100,7 +99,7 @@ public abstract class AbstractGitPushOrPullCommand extends AbstractGitCommand {
|
||||
}
|
||||
|
||||
protected String getRemoteUrl(File directory) {
|
||||
return SCHEME.concat(directory.getAbsolutePath());
|
||||
return directory.toURI().toASCIIString();
|
||||
}
|
||||
|
||||
protected String getRemoteUrl(sonia.scm.repository.Repository repository) {
|
||||
|
||||
@@ -74,7 +74,7 @@ public class GitPushCommandTest extends AbstractRemoteCommandTestBase
|
||||
PushResponse response = cmd.push(request);
|
||||
|
||||
assertNotNull(response);
|
||||
assertEquals(2l, response.getChangesetCount());
|
||||
assertEquals(2L, response.getChangesetCount());
|
||||
|
||||
Iterator<RevCommit> commits = incoming.log().call().iterator();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user