* Don't post process commit summary in templates
Don't run summary through render/post process to avoid it generating
links and breaking certain views where the summary is already expected
to be a link to the commit. For consistancy, disable processing of
summary in all locations.
Fixes#6809
* Do process title on diff page
On second thought, the title is often the only place a pull request
number will exists so do process it on the individual diff page. This
fixes the list view and still gives easy access to the PR link
* Add GET requests to webhook
* make fmt
* Handle invalid http method on webhook
* Uppercase http method in webhook
* Rename v85.go to v86.go
* make fmt
* Call Git API to determine divergence of a branch and its base branch
Signed-off-by: Mario Lubenka <mario.lubenka@googlemail.com>
* Show commit divergance in branch list
Signed-off-by: Mario Lubenka <mario.lubenka@googlemail.com>
* Adds missing comment
Signed-off-by: Mario Lubenka <mario.lubenka@googlemail.com>
* Adds test for diverging commits
Signed-off-by: Mario Lubenka <mario.lubenka@googlemail.com>
* Try comparing commits instead of branches
Signed-off-by: Mario Lubenka <mario.lubenka@googlemail.com>
* Removes test as CI can't run it
Signed-off-by: Mario Lubenka <mario.lubenka@googlemail.com>
* Adjusts signature of percentage function to allow providing multiple integers as numerator
Signed-off-by: Mario Lubenka <mario.lubenka@googlemail.com>
* Moves CountDivergingCommits function into repofiles module
Signed-off-by: Mario Lubenka <mario.lubenka@googlemail.com>
* Allow git.GetTree to take both commit and tree names, return full paths on entries listed through Tree.ListEntriesRecursive
Signed-off-by: Filip Navara <filip.navara@gmail.com>
* Fix the SHA returned on Git Tree APIs called with commit hash or symbolic name
Signed-off-by: Filip Navara <filip.navara@gmail.com>
Although #591 attempted to make version hashes be preceded with tag names on our branch builds, it would fail again silently at 50 commits because we were not cloning the full branch. Drone's new plugin will do a single branch clone by default meaning that depth is no longer necessary.
* Improve issue reference on commit
Allow commits to properly reference issues in other repositories and also to
close/reopen those issues if user has code permission. Should match
Github behavior described here: https://help.github.com/en/articles/closing-issues-using-keywords
Fixes 6664
* Fix missing return
* Match user/repo directly in regex
Ensures correctly traversing the commit graph for all path and avoids
erroneously skipping some. Also preallocate some arrays to correct size
to prevent unnecessary reallocations.
Fixes#6708.
Signed-off-by: Filip Navara <filip.navara@gmail.com>
* detect and remove a decoded BOM
Signed-off-by: Andrew Thornton <art27@cantab.net>
* Restore the previous encoding and BOM
* On error keep as UTF-8
Signed-off-by: Andrew Thornton <art27@cantab.net>
* create remove BOM function
* Deal with LFSed content
* Update modules/repofiles/update.go
* Fix final LFS bug
* Keep LFS sections referring to opts.Content