Skip to content

Commit 8eacb3d

Browse files
committed
simplify
1 parent ed7066e commit 8eacb3d

File tree

2 files changed

+4
-6
lines changed

2 files changed

+4
-6
lines changed

templates/repo/commits.tmpl

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,11 @@
88

99
{{$branchDropdownCurrentRefType := "branch"}}
1010
{{$branchDropdownCurrentRefShortName := .RefName}}
11-
{{if and (not .IsViewBranch) (not .IsViewTag)}}
12-
{{$branchDropdownCurrentRefShortName = ShortSha .RefName}}
13-
{{end}}
1411
{{if .IsViewTag}}
1512
{{$branchDropdownCurrentRefType = "tag"}}
1613
{{$branchDropdownCurrentRefShortName = .TagName}}
14+
{{else if not .IsViewBranch}}
15+
{{$branchDropdownCurrentRefShortName = ShortSha .RefName}}
1716
{{end}}
1817
{{template "repo/branch_dropdown" dict
1918
"Repository" .Repository

templates/repo/home.tmpl

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,11 @@
2626
<div class="repo-button-row-left">
2727
{{$branchDropdownCurrentRefType := "branch"}}
2828
{{$branchDropdownCurrentRefShortName := .RefName}}
29-
{{if and (not .IsViewBranch) (not .IsViewTag)}}
30-
{{$branchDropdownCurrentRefShortName = ShortSha .RefName}}
31-
{{end}}
3229
{{if .IsViewTag}}
3330
{{$branchDropdownCurrentRefType = "tag"}}
3431
{{$branchDropdownCurrentRefShortName = .TagName}}
32+
{{else if not .IsViewBranch}}
33+
{{$branchDropdownCurrentRefShortName = ShortSha .RefName}}
3534
{{end}}
3635
{{template "repo/branch_dropdown" dict
3736
"Repository" .Repository

0 commit comments

Comments
 (0)