|
|
|
@ -76,13 +76,14 @@ public class GitRepositoryService {
|
|
|
|
|
Repository localRepo = new FileRepository(getProjectGitDirectory(repositoryUrl));
|
|
|
|
|
Git git = new Git(localRepo);
|
|
|
|
|
git.pull().call();
|
|
|
|
|
Ref ref = git.checkout().
|
|
|
|
|
setCreateBranch(true).
|
|
|
|
|
setName(branchName).
|
|
|
|
|
setUpstreamMode(CreateBranchCommand.SetupUpstreamMode.TRACK).
|
|
|
|
|
setStartPoint("origin/" + branchName).
|
|
|
|
|
call();
|
|
|
|
|
|
|
|
|
|
if (!localRepo.getBranch().equals(branchName)) {
|
|
|
|
|
Ref ref = git.checkout().
|
|
|
|
|
setCreateBranch(true).
|
|
|
|
|
setName(branchName).
|
|
|
|
|
setUpstreamMode(CreateBranchCommand.SetupUpstreamMode.TRACK).
|
|
|
|
|
setStartPoint("origin/" + branchName).
|
|
|
|
|
call();
|
|
|
|
|
}
|
|
|
|
|
List<RevCommit> commits = new ArrayList<>();
|
|
|
|
|
git.log().call().forEach(commits::add);
|
|
|
|
|
|
|
|
|
@ -92,7 +93,8 @@ public class GitRepositoryService {
|
|
|
|
|
Commit commit = new Commit(
|
|
|
|
|
revCommit.getFullMessage(),
|
|
|
|
|
new Author(revCommit.getAuthorIdent().getName()),
|
|
|
|
|
Date.from(Instant.ofEpochSecond(revCommit.getCommitTime())));
|
|
|
|
|
Date.from(Instant.ofEpochSecond(revCommit.getCommitTime())),
|
|
|
|
|
revCommit.getName());
|
|
|
|
|
if (prevCommit != null) {
|
|
|
|
|
commit.setFileChanges(findDiffBetweenTwoRevisions(revCommit, prevCommit, localRepo));
|
|
|
|
|
}
|
|
|
|
|