mirror of
https://github.com/go-gitea/git.git
synced 2026-07-19 14:33:37 -04:00
[PR #88] [MERGED] Refactor CommitsBefore method to match github #94
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/go-gitea/git/pull/88
Author: @daviian
Created: 10/11/2017
Status: ✅ Merged
Merged: 12/10/2017
Merged by: @lafriks
Base:
master← Head:refactor/allow-sorting📝 Commits (2)
24c0a0crefactored CommitsBefore methodd2765e6add limit to getBranches📊 Changes
1 file changed (+38 additions, -50 deletions)
View changed files
📝
repo_commit.go(+38 -50)📄 Description
The CommitsBefore method is
onlyused to retrieve commits for the push webhook if a new branch is pushed.Namely at https://github.com/go-gitea/gitea/blob/a4cd4616c6f8524f8eb79d6184e855b3a8164130/models/update.go#L229
The refactored method now returns exactly those commits which were added in the new branch and are not existing in any other branch.
This result now behaves exactly as github (compared to the webhook result) except for the order.
The order will be fixed in a separate PR as there is another method which needs order fixing.
All these changes are necessary to implement https://github.com/go-gitea/gitea/pull/2548
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.