mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2025-05-16 15:02:43 +00:00
Improve push update options (#10105)
* Improve push update options * fix test * More refactor and fix lint * fix lint * Fix lint Co-authored-by: Lauris BH <lauris@nix.lv>
This commit is contained in:
parent
70aa629ae7
commit
bf1970d0bd
5 changed files with 193 additions and 153 deletions
|
@ -32,9 +32,11 @@ func TestCommitRepoAction(t *testing.T) {
|
|||
userID: 2,
|
||||
repositoryID: 16,
|
||||
commitRepoActionOptions: CommitRepoActionOptions{
|
||||
RefFullName: "refName",
|
||||
OldCommitID: "oldCommitID",
|
||||
NewCommitID: "newCommitID",
|
||||
PushUpdateOptions: PushUpdateOptions{
|
||||
RefFullName: "refName",
|
||||
OldCommitID: "oldCommitID",
|
||||
NewCommitID: "newCommitID",
|
||||
},
|
||||
Commits: &repository.PushCommits{
|
||||
Commits: []*repository.PushCommit{
|
||||
{
|
||||
|
@ -66,10 +68,12 @@ func TestCommitRepoAction(t *testing.T) {
|
|||
userID: 2,
|
||||
repositoryID: 1,
|
||||
commitRepoActionOptions: CommitRepoActionOptions{
|
||||
RefFullName: git.TagPrefix + "v1.1",
|
||||
OldCommitID: git.EmptySHA,
|
||||
NewCommitID: "newCommitID",
|
||||
Commits: &repository.PushCommits{},
|
||||
PushUpdateOptions: PushUpdateOptions{
|
||||
RefFullName: git.TagPrefix + "v1.1",
|
||||
OldCommitID: git.EmptySHA,
|
||||
NewCommitID: "newCommitID",
|
||||
},
|
||||
Commits: &repository.PushCommits{},
|
||||
},
|
||||
action: models.Action{
|
||||
OpType: models.ActionPushTag,
|
||||
|
@ -80,10 +84,12 @@ func TestCommitRepoAction(t *testing.T) {
|
|||
userID: 2,
|
||||
repositoryID: 1,
|
||||
commitRepoActionOptions: CommitRepoActionOptions{
|
||||
RefFullName: git.TagPrefix + "v1.1",
|
||||
OldCommitID: "oldCommitID",
|
||||
NewCommitID: git.EmptySHA,
|
||||
Commits: &repository.PushCommits{},
|
||||
PushUpdateOptions: PushUpdateOptions{
|
||||
RefFullName: git.TagPrefix + "v1.1",
|
||||
OldCommitID: "oldCommitID",
|
||||
NewCommitID: git.EmptySHA,
|
||||
},
|
||||
Commits: &repository.PushCommits{},
|
||||
},
|
||||
action: models.Action{
|
||||
OpType: models.ActionDeleteTag,
|
||||
|
@ -94,10 +100,12 @@ func TestCommitRepoAction(t *testing.T) {
|
|||
userID: 2,
|
||||
repositoryID: 1,
|
||||
commitRepoActionOptions: CommitRepoActionOptions{
|
||||
RefFullName: git.BranchPrefix + "feature/1",
|
||||
OldCommitID: "oldCommitID",
|
||||
NewCommitID: git.EmptySHA,
|
||||
Commits: &repository.PushCommits{},
|
||||
PushUpdateOptions: PushUpdateOptions{
|
||||
RefFullName: git.BranchPrefix + "feature/1",
|
||||
OldCommitID: "oldCommitID",
|
||||
NewCommitID: git.EmptySHA,
|
||||
},
|
||||
Commits: &repository.PushCommits{},
|
||||
},
|
||||
action: models.Action{
|
||||
OpType: models.ActionDeleteBranch,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue