(refs #324)Update commitIdFrom when pullrequest branch is updated

This commit is contained in:
Tomofumi Tanaka
2014-04-29 16:57:01 +09:00
parent 1900aefe32
commit dd694d27b5
4 changed files with 25 additions and 15 deletions

View File

@@ -617,5 +617,16 @@ object JGitUtil {
}
}
/**
* Returns the identifier of the root commit (or latest merge commit) of the specified branch.
*/
def getForkedCommitId(oldGit: Git, newGit: Git,
userName: String, repositoryName: String, branch: String,
requestUserName: String, requestRepositoryName: String, requestBranch: String): String =
defining(getAllCommitIds(oldGit)){ existIds =>
getCommitLogs(newGit, requestBranch, true) { commit =>
existIds.contains(commit.name) && getBranchesOfCommit(oldGit, commit.getName).contains(branch)
}.head.id
}
}