|
@@ -18,6 +18,7 @@ import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Component;
|
|
import org.springframework.stereotype.Component;
|
|
|
|
|
|
|
|
import java.io.*;
|
|
import java.io.*;
|
|
|
|
|
+import java.net.URLDecoder;
|
|
|
import java.util.*;
|
|
import java.util.*;
|
|
|
import java.util.stream.Collectors;
|
|
import java.util.stream.Collectors;
|
|
|
|
|
|
|
@@ -224,11 +225,16 @@ public class ProjectServiceImpl implements ProjectService {
|
|
|
|
|
|
|
|
@Override
|
|
@Override
|
|
|
public List<CommitVO> getCommitsByBranch(int projectId, String branchName) throws GitLabApiException {
|
|
public List<CommitVO> getCommitsByBranch(int projectId, String branchName) throws GitLabApiException {
|
|
|
- List<Commit> commits=gitlabApi.getCommitsApi().getCommits(projectId, branchName,null,null);
|
|
|
|
|
- if (commits.size() != 0){
|
|
|
|
|
- return commits.stream()
|
|
|
|
|
- .map(com -> castCommitToVO(com,branchName))
|
|
|
|
|
- .collect(Collectors.toList());
|
|
|
|
|
|
|
+ try {
|
|
|
|
|
+ String branchNameDecode = URLDecoder.decode(branchName, "UTF-8");
|
|
|
|
|
+ List<Commit> commits=gitlabApi.getCommitsApi().getCommits(projectId, branchName,null,null);
|
|
|
|
|
+ if (commits.size() != 0){
|
|
|
|
|
+ return commits.stream()
|
|
|
|
|
+ .map(com -> castCommitToVO(com,branchNameDecode))
|
|
|
|
|
+ .collect(Collectors.toList());
|
|
|
|
|
+ }
|
|
|
|
|
+ } catch (UnsupportedEncodingException e) {
|
|
|
|
|
+ throw new RuntimeException(e);
|
|
|
}
|
|
}
|
|
|
return null;
|
|
return null;
|
|
|
}
|
|
}
|