@@ -2020,15 +2020,15 @@ func Test_CreateRepository(t *testing.T) {
20202020 expectedRepo : mockRepo ,
20212021 },
20222022 {
2023- name : "successful repository creation with minimal parameters" ,
2023+ name : "successful repository creation with minimal parameters defaults to private " ,
20242024 mockedClient : NewMockedHTTPClient (
20252025 WithRequestMatchHandler (
20262026 EndpointPattern ("POST /user/repos" ),
20272027 expectRequestBody (t , map [string ]any {
20282028 "name" : "test-repo" ,
20292029 "auto_init" : false ,
20302030 "description" : "" ,
2031- "private" : false ,
2031+ "private" : true ,
20322032 }).andThen (
20332033 mockResponse (t , http .StatusCreated , mockRepo ),
20342034 ),
@@ -2040,6 +2040,28 @@ func Test_CreateRepository(t *testing.T) {
20402040 expectError : false ,
20412041 expectedRepo : mockRepo ,
20422042 },
2043+ {
2044+ name : "successful public repository creation when private is explicitly false" ,
2045+ mockedClient : NewMockedHTTPClient (
2046+ WithRequestMatchHandler (
2047+ EndpointPattern ("POST /user/repos" ),
2048+ expectRequestBody (t , map [string ]any {
2049+ "name" : "test-repo" ,
2050+ "auto_init" : false ,
2051+ "description" : "" ,
2052+ "private" : false ,
2053+ }).andThen (
2054+ mockResponse (t , http .StatusCreated , mockRepo ),
2055+ ),
2056+ ),
2057+ ),
2058+ requestArgs : map [string ]any {
2059+ "name" : "test-repo" ,
2060+ "private" : false ,
2061+ },
2062+ expectError : false ,
2063+ expectedRepo : mockRepo ,
2064+ },
20432065 {
20442066 name : "repository creation fails" ,
20452067 mockedClient : NewMockedHTTPClient (
0 commit comments