Skip to content

Commit

Permalink
rename master to main for github.com/gitignore branch
Browse files Browse the repository at this point in the history
  • Loading branch information
christian-korneck committed Jan 5, 2022
1 parent d3a4237 commit ac78eff
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions cmd/getignore.go
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ func getPaths(baseurl string) (paths []string, err error) {
baseurl = "https://api.github.com"
}

url := fmt.Sprintf("%s/repos/github/gitignore/git/trees/master?recursive=1", baseurl)
url := fmt.Sprintf("%s/repos/github/gitignore/git/trees/main?recursive=1", baseurl)

resp, err := http.Get(url)
if err != nil {
Expand Down Expand Up @@ -216,7 +216,7 @@ func (rc *RestClient) Run(args []string) (output string, err error) {
}

for _, lang := range langs {
url := fmt.Sprintf("%s/github/gitignore/master/%s.gitignore", baseurl, lang)
url := fmt.Sprintf("%s/github/gitignore/main/%s.gitignore", baseurl, lang)

resp, err := http.Get(url)
if err != nil {
Expand Down
4 changes: 2 additions & 2 deletions cmd/getignore_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -117,10 +117,10 @@ dist/

func TestRun(t *testing.T) {
server := httptest.NewServer(http.HandlerFunc(func(rw http.ResponseWriter, req *http.Request) {
if req.URL.String() == "/repos/github/gitignore/git/trees/master?recursive=1" {
if req.URL.String() == "/repos/github/gitignore/git/trees/main?recursive=1" {
rw.Write([]byte(cannedTreeResponse))
}
if req.URL.String() == "/github/gitignore/master/Go.gitignore" {
if req.URL.String() == "/github/gitignore/main/Go.gitignore" {
rw.Write([]byte(cannedGitignore))
}
}))
Expand Down

0 comments on commit ac78eff

Please sign in to comment.