mirror of
https://github.com/go-gitea/gitea
synced 2025-07-22 02:08:36 +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:
@@ -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,
|
||||
|
Reference in New Issue
Block a user