diff --git a/options/locale/locale_en-US.ini b/options/locale/locale_en-US.ini index bdae9a29a..8253c6ced 100644 --- a/options/locale/locale_en-US.ini +++ b/options/locale/locale_en-US.ini @@ -1505,6 +1505,7 @@ issues.action_check_all = Check/Uncheck all items issues.opened_by = opened %[1]s by %[3]s pulls.merged_by = by %[3]s was merged %[1]s pulls.merged_by_fake = by %[2]s was merged %[1]s +pulls.made_using_agit = AGit issues.closed_by = by %[3]s was closed %[1]s issues.opened_by_fake = opened %[1]s by %[2]s issues.closed_by_fake = by %[2]s was closed %[1]s diff --git a/routers/web/repo/pull.go b/routers/web/repo/pull.go index ab821f888..ac244b155 100644 --- a/routers/web/repo/pull.go +++ b/routers/web/repo/pull.go @@ -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) diff --git a/templates/repo/issue/view_title.tmpl b/templates/repo/issue/view_title.tmpl index 582e9864f..8a5954681 100644 --- a/templates/repo/issue/view_title.tmpl +++ b/templates/repo/issue/view_title.tmpl @@ -47,7 +47,9 @@ {{if .HeadBranchLink}} {{$headHref = printf `%s` (.HeadBranchLink | Escape) $headHref}} {{end}} - {{$headHref = printf `%s ` $headHref (ctx.Locale.Tr "copy_branch") (.HeadTarget | Escape) (svg "octicon-copy" 14)}} + {{if not .MadeUsingAGit}} + {{$headHref = printf `%s ` $headHref (ctx.Locale.Tr "copy_branch") (.HeadTarget | Escape) (svg "octicon-copy" 14)}} + {{end}} {{$baseHref := .BaseTarget|Escape}} {{if .BaseBranchLink}} {{$baseHref = printf `%s` (.BaseBranchLink | Escape) $baseHref}} @@ -70,6 +72,12 @@ {{ctx.Locale.Tr "repo.pulls.title_desc" .NumCommits ($headHref|Safe) ($baseHref|Safe)}} {{end}} + {{if .MadeUsingAGit}} + {{/* TODO: Add tooltip and a link to the documentation */}} + + {{ctx.Locale.Tr "repo.pulls.made_using_agit"}} + + {{end}}