summaryrefslogtreecommitdiffstats
path: root/services/pull/update.go
diff options
context:
space:
mode:
Diffstat (limited to 'services/pull/update.go')
-rw-r--r--services/pull/update.go9
1 files changed, 9 insertions, 0 deletions
diff --git a/services/pull/update.go b/services/pull/update.go
index f35e47cbf8..c2c13845e3 100644
--- a/services/pull/update.go
+++ b/services/pull/update.go
@@ -22,6 +22,11 @@ func Update(pull *models.PullRequest, doer *models.User, message string) error {
BaseBranch: pull.HeadBranch,
}
+ if pull.Flow == models.PullRequestFlowAGit {
+ // TODO: Not support update agit flow pull request's head branch
+ return fmt.Errorf("Not support update agit flow pull request's head branch")
+ }
+
if err := pr.LoadHeadRepo(); err != nil {
log.Error("LoadHeadRepo: %v", err)
return fmt.Errorf("LoadHeadRepo: %v", err)
@@ -48,6 +53,10 @@ func Update(pull *models.PullRequest, doer *models.User, message string) error {
// IsUserAllowedToUpdate check if user is allowed to update PR with given permissions and branch protections
func IsUserAllowedToUpdate(pull *models.PullRequest, user *models.User) (bool, error) {
+ if pull.Flow == models.PullRequestFlowAGit {
+ return false, nil
+ }
+
if user == nil {
return false, nil
}