Repositories

Modified repository/git.go

@@ -168,6 +168,7 @@ func (repo *GitRepo) GetCommitTime(ref string) string {
return repo.runGitCommandOrDie("show", "-s", "--format=%ct", ref)
}
// GetLastParent returns the last parent of the given commit (as ordered by git).
func (repo *GitRepo) GetLastParent(ref string) (string, error) {
return repo.runGitCommand("rev-list", "--skip", "1", "-n", "1", ref)
}

Modified repository/repo.go

@@ -63,6 +63,7 @@ type Repo interface {
// GetCommitTime returns the commit time of the commit pointed to by the given ref.
GetCommitTime(ref string) string
// GetLastParent returns the last parent of the given commit (as ordered by git).
GetLastParent(ref string) (string, error)
// MergeBase determines if the first commit that is an ancestor of the two arguments.