1
0
mirror of https://github.com/go-gitea/gitea.git synced 2024-12-04 14:46:57 -05:00
gitea/routers
Bo-Yi Wu c70e442ce4
feat(api): implement branch/commit comparison API (#30349)
- Add new `Compare` struct to represent comparison between two commits
- Introduce new API endpoint `/compare/*` to get commit comparison
information
- Create new file `repo_compare.go` with the `Compare` struct definition
- Add new file `compare.go` in `routers/api/v1/repo` to handle
comparison logic
- Add new file `compare.go` in `routers/common` to define `CompareInfo`
struct
- Refactor `ParseCompareInfo` function to use `common.CompareInfo`
struct
- Update Swagger documentation to include the new API endpoint for
commit comparison
- Remove duplicate `CompareInfo` struct from
`routers/web/repo/compare.go`
- Adjust base path in Swagger template to be relative (`/api/v1`)

GitHub API
https://docs.github.com/en/rest/commits/commits?apiVersion=2022-11-28#compare-two-commits

---------

Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
2024-04-16 11:45:04 +08:00
..
api feat(api): implement branch/commit comparison API (#30349) 2024-04-16 11:45:04 +08:00
common feat(api): implement branch/commit comparison API (#30349) 2024-04-16 11:45:04 +08:00
install Move context from modules to services (#29440) 2024-02-27 08:12:22 +01:00
private Performance optimization for git push (#30104) 2024-04-09 03:43:17 +00:00
utils Refactor external URL detection (#29973) 2024-03-22 04:32:40 +08:00
web feat(api): implement branch/commit comparison API (#30349) 2024-04-16 11:45:04 +08:00
init.go Move some asymkey functions to service layer (#28894) 2024-03-04 08:57:39 +00:00