Skip to content

Commit 0567944

Browse files
authored
Merge branch 'main' into show-sync-time
2 parents 4dbebe1 + e75e9a0 commit 0567944

File tree

4 files changed

+11
-5
lines changed

4 files changed

+11
-5
lines changed

modules/setting/database.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ func getPostgreSQLConnectionString(dbHost, dbUser, dbPasswd, dbName, dbsslMode s
168168
RawQuery: dbParam,
169169
}
170170
query := connURL.Query()
171-
if dbHost[0] == '/' { // looks like a unix socket
171+
if strings.HasPrefix(dbHost, "/") { // looks like a unix socket
172172
query.Add("host", dbHost)
173173
connURL.Host = ":" + port
174174
}

modules/setting/database_test.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,10 @@ func Test_getPostgreSQLConnectionString(t *testing.T) {
6565
SSLMode string
6666
Output string
6767
}{
68+
{
69+
Host: "", // empty means default
70+
Output: "postgres://:@127.0.0.1:5432?sslmode=",
71+
},
6872
{
6973
Host: "/tmp/pg.sock",
7074
User: "testuser",

templates/repo/diff/compare.tmpl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
{{- end -}}
3737
{{- end -}}
3838
<div class="ui segment choose branch">
39-
<a href="{{$.HeadRepo.Link}}/compare/{{PathEscapeSegments $.HeadBranch}}{{$.CompareSeparator}}{{if not $.PullRequestCtx.SameRepo}}{{PathEscape $.BaseName}}/{{PathEscape $.Repository.Name}}:{{end}}{{PathEscapeSegments $.BaseBranch}}" title="{{ctx.Locale.Tr "repo.pulls.switch_head_and_base"}}">{{svg "octicon-git-compare"}}</a>
39+
<a class="gt-mr-3" href="{{$.HeadRepo.Link}}/compare/{{PathEscapeSegments $.HeadBranch}}{{$.CompareSeparator}}{{if not $.PullRequestCtx.SameRepo}}{{PathEscape $.BaseName}}/{{PathEscape $.Repository.Name}}:{{end}}{{PathEscapeSegments $.BaseBranch}}" title="{{ctx.Locale.Tr "repo.pulls.switch_head_and_base"}}">{{svg "octicon-git-compare"}}</a>
4040
<div class="ui floating filter dropdown" data-no-results="{{ctx.Locale.Tr "repo.pulls.no_results"}}">
4141
<div class="ui basic small button">
4242
<span class="text">{{if $.PageIsComparePull}}{{ctx.Locale.Tr "repo.pulls.compare_base"}}{{else}}{{ctx.Locale.Tr "repo.compare.compare_base"}}{{end}}: {{$BaseCompareName}}:{{$.BaseBranch}}</span>
@@ -105,7 +105,7 @@
105105
</div>
106106
</div>
107107
</div>
108-
<a href="{{.RepoLink}}/compare/{{PathEscapeSegments .BaseBranch}}{{.OtherCompareSeparator}}{{if not $.PullRequestCtx.SameRepo}}{{PathEscape $.HeadUser.Name}}/{{PathEscape $.HeadRepo.Name}}:{{end}}{{PathEscapeSegments $.HeadBranch}}" title="{{ctx.Locale.Tr "repo.pulls.switch_comparison_type"}}">{{.CompareSeparator}}</a>
108+
<a href="{{.RepoLink}}/compare/{{PathEscapeSegments .BaseBranch}}{{.OtherCompareSeparator}}{{if not $.PullRequestCtx.SameRepo}}{{PathEscape $.HeadUser.Name}}/{{PathEscape $.HeadRepo.Name}}:{{end}}{{PathEscapeSegments $.HeadBranch}}" title="{{ctx.Locale.Tr "repo.pulls.switch_comparison_type"}}">{{svg "octicon-arrow-left" 16}}<div class="compare-separator">{{.CompareSeparator}}</div></a>
109109
<div class="ui floating filter dropdown">
110110
<div class="ui basic small button">
111111
<span class="text">{{if $.PageIsComparePull}}{{ctx.Locale.Tr "repo.pulls.compare_compare"}}{{else}}{{ctx.Locale.Tr "repo.compare.compare_head"}}{{end}}: {{$HeadCompareName}}:{{$.HeadBranch}}</span>

web_src/css/repo.css

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1166,8 +1166,10 @@
11661166
flex-wrap: wrap;
11671167
}
11681168

1169-
.repository .choose.branch .svg {
1170-
margin-right: 10px;
1169+
.repository .choose .compare-separator {
1170+
width: 100%;
1171+
margin-top: -1rem;
1172+
text-align: center;
11711173
}
11721174

11731175
.repository.compare.pull .comment.form .content::before,

0 commit comments

Comments
 (0)