Exemplo n.º 1
0
func (repo *Repository) CommitsByFileAndRange(revision, file string, page int) (*list.List, error) {
	oid, err := rawgit.ResolveName(repo.repo, revision)
	if err != nil {
		return nil, err
	}

	rawCommit, err := repo.repo.OpenCommit(oid)
	if err != nil {
		return nil, err
	}

	commit, err := raw2commit(repo, rawCommit)
	if err != nil {
		return nil, err
	}

	return repo.commitsByFileAndRange(commit, file, page)
}
Exemplo n.º 2
0
func (repo *Repository) FileCommitsCount(revision, file string) (int64, error) {
	oid, err := rawgit.ResolveName(repo.repo, revision)
	if err != nil {
		return 0, err
	}

	rawCommit, err := repo.repo.OpenCommit(oid)
	if err != nil {
		return 0, err
	}

	commit, err := raw2commit(repo, rawCommit)
	if err != nil {
		return 0, err
	}

	return repo.fileCommitsCount(commit, file)
}