mirror of
https://github.com/go-gitea/gitea.git
synced 2024-05-11 05:55:29 +00:00
* Adds functionality to change target branch of created pull requests Signed-off-by: Mario Lubenka <[email protected]> * Use const instead of var in JavaScript additions Signed-off-by: Mario Lubenka <[email protected]> * Check if branches are equal and if PR already exists before changing target branch Signed-off-by: Mario Lubenka <[email protected]> * Make sure to check all commits Signed-off-by: Mario Lubenka <[email protected]> * Print error messages for user as error flash message Signed-off-by: Mario Lubenka <[email protected]> * Disallow changing target branch of closed or merged pull requests Signed-off-by: Mario Lubenka <[email protected]> * Resolve conflicts after merge of upstream/master Signed-off-by: Mario Lubenka <[email protected]> * Change order of branch select fields Signed-off-by: Mario Lubenka <[email protected]> * Removes duplicate check Signed-off-by: Mario Lubenka <[email protected]> * Use ctx.Tr for translations Signed-off-by: Mario Lubenka <[email protected]> * Recompile JS Signed-off-by: Mario Lubenka <[email protected]> * Use correct translation namespace Signed-off-by: Mario Lubenka <[email protected]> * Remove redundant if condition Signed-off-by: Mario Lubenka <[email protected]> * Moves most change branch logic into pull service Signed-off-by: Mario Lubenka <[email protected]> * Completes comment Signed-off-by: Mario Lubenka <[email protected]> * Add Ref to ChangesPayload for logging changed target branches instead of creating a new struct Signed-off-by: Mario Lubenka <[email protected]> * Revert changes to go.mod Signed-off-by: Mario Lubenka <[email protected]> * Directly use createComment method Signed-off-by: Mario Lubenka <[email protected]> * Return 404 if pull request is not found. Move written check up Signed-off-by: Mario Lubenka <[email protected]> * Remove variable declaration Signed-off-by: Mario Lubenka <[email protected]> * Return client errors on change pull request target errors Signed-off-by: Mario Lubenka <[email protected]> * Return error in commit.HasPreviousCommit Signed-off-by: Mario Lubenka <[email protected]> * Adds blank line Signed-off-by: Mario Lubenka <[email protected]> * Test patch before persisting new target branch Signed-off-by: Mario Lubenka <[email protected]> * Update patch before testing (not working) Signed-off-by: Mario Lubenka <[email protected]> * Removes patch calls when changeing pull request target Signed-off-by: Mario Lubenka <[email protected]> * Removes unneeded check for base name Signed-off-by: Mario Lubenka <[email protected]> * Moves ChangeTargetBranch completely to pull service. Update patch status. Signed-off-by: Mario Lubenka <[email protected]> * Set webhook mode after errors were validated Signed-off-by: Mario Lubenka <[email protected]> * Update PR in one transaction Signed-off-by: Mario Lubenka <[email protected]> * Move logic for check if head is equal with branch to pull model Signed-off-by: Mario Lubenka <[email protected]> * Adds missing comment and simplify return Signed-off-by: Mario Lubenka <[email protected]> * Adjust CreateComment method call Signed-off-by: Mario Lubenka <[email protected]>
24 lines
435 B
Go
24 lines
435 B
Go
// Copyright 2019 The Gitea Authors. All rights reserved.
|
|
// Use of this source code is governed by a MIT-style
|
|
// license that can be found in the LICENSE file.
|
|
|
|
package migrations
|
|
|
|
import (
|
|
"fmt"
|
|
|
|
"xorm.io/xorm"
|
|
)
|
|
|
|
func featureChangeTargetBranch(x *xorm.Engine) error {
|
|
type Comment struct {
|
|
OldRef string
|
|
NewRef string
|
|
}
|
|
|
|
if err := x.Sync2(new(Comment)); err != nil {
|
|
return fmt.Errorf("Sync2: %v", err)
|
|
}
|
|
return nil
|
|
}
|