]> source.dussan.org Git - gitea.git/commitdiff
Fix the wrong default branch name displayed by checkout (#25777)
authorhiifong <i@hiif.ong>
Sun, 9 Jul 2023 09:09:06 +0000 (17:09 +0800)
committerGitHub <noreply@github.com>
Sun, 9 Jul 2023 09:09:06 +0000 (11:09 +0200)
Related: #22743

Before:

![image](https://github.com/go-gitea/gitea/assets/89133723/3cec886c-589c-41a8-86af-a08b62b8adef)

After:

![image](https://github.com/go-gitea/gitea/assets/89133723/74ee8adf-fca7-42a0-a67a-ecaa0ba91b4a)

templates/repo/branch/list.tmpl

index d7ea299fd1261ff43384c7d59fb6364f24271d37..e9d5cc1efb99c527db8fcb2d0dd4486f045c1f7d 100644 (file)
@@ -33,7 +33,7 @@
                                                                {{if and $.IsWriter (not $.Repository.IsArchived) (not .IsDeleted)}}
                                                                        <button class="btn interact-bg show-create-branch-modal gt-p-3"
                                                                                data-modal="#create-branch-modal"
-                                                                               data-branch-from="{{$.DefaultBranchBranch}}"
+                                                                               data-branch-from="{{$.DefaultBranchBranch.DBBranch.Name}}"
                                                                                data-branch-from-urlcomponent="{{PathEscapeSegments $.DefaultBranchBranch.DBBranch.Name}}"
                                                                                data-tooltip-content="{{$.locale.Tr "repo.branch.new_branch_from" ($.DefaultBranchBranch.DBBranch.Name)}}"
                                                                        >