mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2025-06-22 06:38:32 -04:00
Fix tags view (#23243)
This PR fixes several issues reported in https://github.com/go-gitea/gitea/issues/23221. It does three things: 1. Fixes the `DefaultBranch` variable that has not been set. 2. Sets `Title` and `Message` for newly created tags from the Tag message. This makes it easier to create releases from tags that have messages and for those that don't it doesn't have any effect. 3. Makes UI changes so that tags look more like proper releases. Before:  After:  I purposefully didn't reformat the template so that the diff is cleaner but can do so if that's welcome. Thanks for your time! --------- Signed-off-by: Wiktor Kwapisiewicz <wiktor@metacode.biz>
This commit is contained in:
parent
22fec1650a
commit
b78c955958
4 changed files with 38 additions and 43 deletions
|
@ -374,15 +374,20 @@ func pushUpdateAddTags(ctx context.Context, repo *repo_model.Repository, gitRepo
|
|||
rel, has := relMap[lowerTag]
|
||||
|
||||
if !has {
|
||||
parts := strings.SplitN(tag.Message, "\n", 2)
|
||||
note := ""
|
||||
if len(parts) > 1 {
|
||||
note = parts[1]
|
||||
}
|
||||
rel = &repo_model.Release{
|
||||
RepoID: repo.ID,
|
||||
Title: "",
|
||||
Title: parts[0],
|
||||
TagName: tags[i],
|
||||
LowerTagName: lowerTag,
|
||||
Target: "",
|
||||
Sha1: commit.ID.String(),
|
||||
NumCommits: commitsCount,
|
||||
Note: "",
|
||||
Note: note,
|
||||
IsDraft: false,
|
||||
IsPrerelease: false,
|
||||
IsTag: true,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue