Skip to content

Commit 1aef123

Browse files
authored
Merge pull request #1 from chetan-rns/master
Update the default branch to main
2 parents e3fd340 + 5f00b26 commit 1aef123

File tree

4 files changed

+13
-13
lines changed

4 files changed

+13
-13
lines changed

pkg/git/client_test.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,15 +16,15 @@ import (
1616

1717
func TestFileContents(t *testing.T) {
1818
m := metrics.NewMock()
19-
as := makeAPIServer(t, "/api/v3/repos/Codertocat/Hello-World/contents/pipelines.yaml", "master", "testdata/content.json")
19+
as := makeAPIServer(t, "/api/v3/repos/Codertocat/Hello-World/contents/pipelines.yaml", "main", "testdata/content.json")
2020
defer as.Close()
2121
scmClient, err := factory.NewClient("github", as.URL, "", factory.Client(as.Client()))
2222
if err != nil {
2323
t.Fatal(err)
2424
}
2525
client := New(scmClient, m)
2626

27-
body, err := client.FileContents(context.TODO(), "Codertocat/Hello-World", "pipelines.yaml", "master")
27+
body, err := client.FileContents(context.TODO(), "Codertocat/Hello-World", "pipelines.yaml", "main")
2828
if err != nil {
2929
t.Fatal(err)
3030
}
@@ -39,15 +39,15 @@ func TestFileContents(t *testing.T) {
3939

4040
func TestFileContentsWithNotFoundResponse(t *testing.T) {
4141
m := metrics.NewMock()
42-
as := makeAPIServer(t, "/api/v3/repos/Codertocat/Hello-World/contents/pipelines.yaml", "master", "")
42+
as := makeAPIServer(t, "/api/v3/repos/Codertocat/Hello-World/contents/pipelines.yaml", "main", "")
4343
defer as.Close()
4444
scmClient, err := factory.NewClient("github", as.URL, "", factory.Client(as.Client()))
4545
if err != nil {
4646
t.Fatal(err)
4747
}
4848
client := New(scmClient, m)
4949

50-
_, err = client.FileContents(context.TODO(), "Codertocat/Hello-World", "pipelines.yaml", "master")
50+
_, err = client.FileContents(context.TODO(), "Codertocat/Hello-World", "pipelines.yaml", "main")
5151
if !IsNotFound(err) {
5252
t.Fatalf("failed with %#v", err)
5353
}
@@ -64,7 +64,7 @@ func TestFileContentsUnableToConnect(t *testing.T) {
6464
}
6565
client := New(scmClient, m)
6666

67-
_, err = client.FileContents(context.TODO(), "Codertocat/Hello-World", "pipelines.yaml", "master")
67+
_, err = client.FileContents(context.TODO(), "Codertocat/Hello-World", "pipelines.yaml", "main")
6868
if !test.MatchError(t, "connection refused", err) {
6969
t.Fatal(err)
7070
}

pkg/git/testdata/push_hook.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -105,9 +105,9 @@
105105
"forks": 1,
106106
"open_issues": 2,
107107
"watchers": 0,
108-
"default_branch": "master",
108+
"default_branch": "main",
109109
"stargazers": 0,
110-
"master_branch": "master"
110+
"main_branch": "main"
111111
},
112112
"pusher": {
113113
"name": "Codertocat",

pkg/httpapi/api.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ var DefaultSecretRef = types.NamespacedName{
2424
Namespace: "pipelines-app-delivery",
2525
}
2626

27-
const defaultRef = "master"
27+
const defaultRef = "main"
2828

2929
// APIRouter is an HTTP API for accessing app configurations.
3030
type APIRouter struct {

pkg/httpapi/api_test.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ const (
2727

2828
func TestGetPipelines(t *testing.T) {
2929
ts, c := makeServer(t)
30-
c.addContents("example/gitops", "pipelines.yaml", "master", "testdata/pipelines.yaml")
30+
c.addContents("example/gitops", "pipelines.yaml", "main", "testdata/pipelines.yaml")
3131
pipelinesURL := "https://github.com/example/gitops.git"
3232

3333
req := makeClientRequest(t, "Bearer testing", fmt.Sprintf("%s/pipelines?url=%s", ts.URL, pipelinesURL))
@@ -81,7 +81,7 @@ func TestGetPipelinesWithNoURL(t *testing.T) {
8181

8282
func TestGetPipelinesWithBadURL(t *testing.T) {
8383
ts, c := makeServer(t)
84-
c.addContents("example/gitops", "pipelines.yaml", "master", "testdata/pipelines.yaml")
84+
c.addContents("example/gitops", "pipelines.yaml", "main", "testdata/pipelines.yaml")
8585
req := makeClientRequest(t, "Bearer testing", fmt.Sprintf("%s/pipelines?url=%%%%test.html", ts.URL))
8686
res, err := ts.Client().Do(req)
8787
if err != nil {
@@ -115,7 +115,7 @@ func TestGetPipelinesWithNamespaceAndNameInURL(t *testing.T) {
115115
ts, c := makeServer(t, func(a *APIRouter) {
116116
a.secretGetter = sg
117117
})
118-
c.addContents("example/gitops", "pipelines.yaml", "master", "testdata/pipelines.yaml")
118+
c.addContents("example/gitops", "pipelines.yaml", "main", "testdata/pipelines.yaml")
119119
pipelinesURL := "https://github.com/example/gitops.git"
120120
options := url.Values{
121121
"url": []string{pipelinesURL},
@@ -142,7 +142,7 @@ func TestGetPipelinesWithNamespaceAndNameInURL(t *testing.T) {
142142

143143
func TestGetPipelinesWithUnknownSecret(t *testing.T) {
144144
ts, c := makeServer(t)
145-
c.addContents("example/gitops", "pipelines.yaml", "master", "testdata/pipelines.yaml")
145+
c.addContents("example/gitops", "pipelines.yaml", "main", "testdata/pipelines.yaml")
146146
pipelinesURL := "https://github.com/example/gitops.git"
147147
options := url.Values{
148148
"url": []string{pipelinesURL},
@@ -173,7 +173,7 @@ func TestGetPipelineApplication(t *testing.T) {
173173
ts, c := makeServer(t, func(a *APIRouter) {
174174
a.resourceParser = stubResourceParser(testResource)
175175
})
176-
c.addContents("example/gitops", "pipelines.yaml", "master", "testdata/pipelines.yaml")
176+
c.addContents("example/gitops", "pipelines.yaml", "main", "testdata/pipelines.yaml")
177177
pipelinesURL := "https://github.com/example/gitops.git"
178178
options := url.Values{
179179
"url": []string{pipelinesURL},

0 commit comments

Comments
 (0)