Merge pull request '[UI] Agit: Add AGit label to AGit-created PRs' (#2444) from n0toose/agit-indicator into forgejo

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/2444
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
This commit is contained in:
Earl Warren 2024-02-25 14:48:09 +00:00
commit ef1d579c41
4 changed files with 43 additions and 4 deletions

View file

@ -1,5 +1,6 @@
// Copyright 2018 The Gitea Authors.
// Copyright 2014 The Gogs Authors.
// Copyright 2014 The Gogs Authors. All rights reserved.
// Copyright 2018 The Gitea Authors. All rights reserved.
// Copyright 2024 The Forgejo Authors. All rights reserved.
// All rights reserved.
// SPDX-License-Identifier: MIT
@ -381,6 +382,11 @@ func setMergeTarget(ctx *context.Context, pull *issues_model.PullRequest) {
} else {
ctx.Data["HeadTarget"] = pull.MustHeadUserName(ctx) + "/" + pull.HeadRepo.Name + ":" + pull.HeadBranch
}
if pull.Flow == issues_model.PullRequestFlowAGit {
ctx.Data["MadeUsingAGit"] = true
}
ctx.Data["BaseTarget"] = pull.BaseBranch
ctx.Data["HeadBranchLink"] = pull.GetHeadBranchLink(ctx)
ctx.Data["BaseBranchLink"] = pull.GetBaseBranchLink(ctx)