Commit 8ad75f6b by wuxixi

1.修改复制到本地的空格问题

parent 8c28637c
......@@ -34,6 +34,8 @@ public class GitlabUtil {
*/
public static void clone(GitlabCloneReq req, UsernamePasswordCredentialsProvider provider, GitlabProject project, CountDownLatch countDownLatch) {
CloneCommand cloneCommand = Git.cloneRepository();
String dir = req.getDir() + "/" + project.getNameWithNamespace();
dir=dir.replace(" ","");
try {
Git git = cloneCommand
.setURI(project.getHttpUrl())
......@@ -61,11 +63,13 @@ public class GitlabUtil {
}
}
})
.setDirectory(new File(req.getDir() + "/" + project.getNameWithNamespace()))
.setDirectory(new File(dir))
.setCredentialsProvider(provider)
.call();
} catch (Exception ex) {
// 克隆失败则打印错误日志、计数器-1
ex.printStackTrace();
log.error("<== 克隆项目=【{}】失败,原因=【{}】", project.getName(), ex.getMessage());
countDownLatch.countDown();
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment