Commit 8ad75f6b by wuxixi

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

parent 8c28637c
...@@ -34,6 +34,8 @@ public class GitlabUtil { ...@@ -34,6 +34,8 @@ public class GitlabUtil {
*/ */
public static void clone(GitlabCloneReq req, UsernamePasswordCredentialsProvider provider, GitlabProject project, CountDownLatch countDownLatch) { public static void clone(GitlabCloneReq req, UsernamePasswordCredentialsProvider provider, GitlabProject project, CountDownLatch countDownLatch) {
CloneCommand cloneCommand = Git.cloneRepository(); CloneCommand cloneCommand = Git.cloneRepository();
String dir = req.getDir() + "/" + project.getNameWithNamespace();
dir=dir.replace(" ","");
try { try {
Git git = cloneCommand Git git = cloneCommand
.setURI(project.getHttpUrl()) .setURI(project.getHttpUrl())
...@@ -61,11 +63,13 @@ public class GitlabUtil { ...@@ -61,11 +63,13 @@ public class GitlabUtil {
} }
} }
}) })
.setDirectory(new File(req.getDir() + "/" + project.getNameWithNamespace())) .setDirectory(new File(dir))
.setCredentialsProvider(provider) .setCredentialsProvider(provider)
.call(); .call();
} catch (Exception ex) { } catch (Exception ex) {
// 克隆失败则打印错误日志、计数器-1 // 克隆失败则打印错误日志、计数器-1
ex.printStackTrace();
log.error("<== 克隆项目=【{}】失败,原因=【{}】", project.getName(), ex.getMessage()); log.error("<== 克隆项目=【{}】失败,原因=【{}】", project.getName(), ex.getMessage());
countDownLatch.countDown(); 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