mirror of
https://github.com/scm-manager/scm-manager.git
synced 2026-01-07 08:02:09 +01:00
Use SCM protocol for internal merge command
This commit is contained in:
@@ -3,6 +3,7 @@ package sonia.scm.repository.spi;
|
||||
import org.eclipse.jgit.api.Git;
|
||||
import org.eclipse.jgit.api.errors.GitAPIException;
|
||||
import org.eclipse.jgit.lib.Repository;
|
||||
import org.eclipse.jgit.transport.ScmTransportProtocol;
|
||||
import org.eclipse.jgit.util.FileUtils;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
@@ -45,12 +46,16 @@ public class SimpleGitWorkdirFactory implements GitWorkdirFactory {
|
||||
|
||||
protected Repository cloneRepository(File bareRepository, File target) throws GitAPIException {
|
||||
return Git.cloneRepository()
|
||||
.setURI(bareRepository.getAbsolutePath())
|
||||
.setURI(createScmTransportProtocolUri(bareRepository))
|
||||
.setDirectory(target)
|
||||
.call()
|
||||
.getRepository();
|
||||
}
|
||||
|
||||
private String createScmTransportProtocolUri(File bareRepository) {
|
||||
return ScmTransportProtocol.NAME + "://" + bareRepository.getAbsolutePath();
|
||||
}
|
||||
|
||||
private void close(Repository repository) {
|
||||
repository.close();
|
||||
try {
|
||||
|
||||
Reference in New Issue
Block a user