diff options
author | Cherrg <michael@gnehr.de> | 2019-07-11 16:45:10 +0200 |
---|---|---|
committer | Lunny Xiao <xiaolunwen@gmail.com> | 2019-07-11 22:45:10 +0800 |
commit | a7b1ba0e3d49e699ce7d6e614bc8605aef0a2c9a (patch) | |
tree | f182ede1617c092badb4feff1c5b2e3edcf70352 /modules/git | |
parent | a0820e09fbf78f84722b44563b5f44a92a8a5a0e (diff) | |
download | gitea-a7b1ba0e3d49e699ce7d6e614bc8605aef0a2c9a.tar.gz gitea-a7b1ba0e3d49e699ce7d6e614bc8605aef0a2c9a.zip |
wiki history improvements (#7391)
* add history comments to detect page delete
Signed-off-by: Michael Gnehr <michael@gnehr.de>
* fix too much history entries
- caused by --follow flag
- if files with same contents exists
Signed-off-by: Michael Gnehr <michael@gnehr.de>
* style imprevements wiki
- history - wrap long author names
Signed-off-by: Michael Gnehr <michael@gnehr.de>
Diffstat (limited to 'modules/git')
-rw-r--r-- | modules/git/repo_commit.go | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/modules/git/repo_commit.go b/modules/git/repo_commit.go index 8ea2a33145..8429a57039 100644 --- a/modules/git/repo_commit.go +++ b/modules/git/repo_commit.go @@ -266,6 +266,16 @@ func (repo *Repository) CommitsByFileAndRange(revision, file string, page int) ( return repo.parsePrettyFormatLogToList(stdout) } +// CommitsByFileAndRangeNoFollow return the commits according revison file and the page +func (repo *Repository) CommitsByFileAndRangeNoFollow(revision, file string, page int) (*list.List, error) { + stdout, err := NewCommand("log", revision, "--skip="+strconv.Itoa((page-1)*50), + "--max-count="+strconv.Itoa(CommitsRangeSize), prettyLogFormat, "--", file).RunInDirBytes(repo.Path) + if err != nil { + return nil, err + } + return repo.parsePrettyFormatLogToList(stdout) +} + // FilesCountBetween return the number of files changed between two commits func (repo *Repository) FilesCountBetween(startCommitID, endCommitID string) (int, error) { stdout, err := NewCommand("diff", "--name-only", startCommitID+"..."+endCommitID).RunInDir(repo.Path) |