diff --git a/github/repos_contents.go b/github/repos_contents.go index de7a0d5b82..d59c735df8 100644 --- a/github/repos_contents.go +++ b/github/repos_contents.go @@ -91,6 +91,8 @@ func (r *RepositoryContent) GetContent() (string, error) { return "", nil } return *r.Content, nil + case "none": + return "", errors.New("unsupported content encoding: none, this may occur when file size > 1 MB, if that is the case consider using DownloadContents") default: return "", fmt.Errorf("unsupported content encoding: %v", encoding) } diff --git a/github/repos_contents_test.go b/github/repos_contents_test.go index ab69b5cdcb..f961306920 100644 --- a/github/repos_contents_test.go +++ b/github/repos_contents_test.go @@ -54,6 +54,12 @@ func TestRepositoryContent_GetContent(t *testing.T) { want: "", wantErr: true, }, + { + encoding: String("none"), + content: nil, + want: "", + wantErr: true, + }, } for _, tt := range tests {