Add new create_fork arguments (#2493)

Adds support for new `create_fork` arguments:
 - `name` - To set the name of the fork on creation
 - `default_branch_only` - To only include the default branch

Signed-off-by: Jonathan Leitschuh <Jonathan.Leitschuh@gmail.com>
This commit is contained in:
Jonathan Leitschuh
2023-05-23 17:40:02 +02:00
committed by GitHub
parent e8075c41dd
commit b94a83cbf3
9 changed files with 62 additions and 26 deletions
@@ -25,8 +25,8 @@ POST
api.github.com
None
/repos/nvie/gitflow/forks
{'Authorization': 'Basic login_and_password_removed', 'User-Agent': 'PyGithub/Python'}
None
{'Authorization': 'Basic login_and_password_removed', 'User-Agent': 'PyGithub/Python', 'Content-Type': 'application/json'}
{}
202
[('status', '202 Accepted'), ('x-ratelimit-remaining', '4958'), ('content-length', '3486'), ('server', 'nginx/1.0.13'), ('connection', 'keep-alive'), ('x-ratelimit-limit', '5000'), ('etag', '"92f5b171559bccda47d7ebb598ba4f73"'), ('date', 'Sat, 26 May 2012 20:23:35 GMT'), ('content-type', 'application/json; charset=utf-8')]
{"parent":{"clone_url":"https://github.com/nvie/gitflow.git","has_downloads":true,"watchers":3973,"updated_at":"2012-05-26T20:23:35Z","master_branch":"develop","homepage":"http://nvie.com/posts/a-successful-git-branching-model/","url":"https://api.github.com/repos/nvie/gitflow","has_wiki":true,"has_issues":true,"fork":false,"forks":331,"size":4602,"private":false,"open_issues":92,"svn_url":"https://github.com/nvie/gitflow","owner":{"url":"https://api.github.com/users/nvie","avatar_url":"https://secure.gravatar.com/avatar/c5a7f21b46df698f3db31c37ed0cf55a?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","gravatar_id":"c5a7f21b46df698f3db31c37ed0cf55a","login":"nvie","id":83844},"name":"gitflow","language":"Shell","description":"Git extensions to provide high-level repository operations for Vincent Driessen's branching model.","ssh_url":"git@github.com:nvie/gitflow.git","git_url":"git://github.com/nvie/gitflow.git","pushed_at":"2012-02-14T13:11:04Z","created_at":"2010-01-20T23:14:12Z","id":481366,"mirror_url":null,"html_url":"https://github.com/nvie/gitflow","full_name":"nvie/gitflow"},"clone_url":"https://github.com/jacquev6/gitflow.git","has_downloads":true,"watchers":1,"updated_at":"2012-05-26T20:23:35Z","source":{"clone_url":"https://github.com/nvie/gitflow.git","has_downloads":true,"watchers":3973,"updated_at":"2012-05-26T20:23:35Z","master_branch":"develop","homepage":"http://nvie.com/posts/a-successful-git-branching-model/","url":"https://api.github.com/repos/nvie/gitflow","has_wiki":true,"has_issues":true,"fork":false,"forks":331,"size":4602,"private":false,"open_issues":92,"svn_url":"https://github.com/nvie/gitflow","owner":{"url":"https://api.github.com/users/nvie","avatar_url":"https://secure.gravatar.com/avatar/c5a7f21b46df698f3db31c37ed0cf55a?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","gravatar_id":"c5a7f21b46df698f3db31c37ed0cf55a","login":"nvie","id":83844},"name":"gitflow","language":"Shell","description":"Git extensions to provide high-level repository operations for Vincent Driessen's branching model.","ssh_url":"git@github.com:nvie/gitflow.git","git_url":"git://github.com/nvie/gitflow.git","pushed_at":"2012-02-14T13:11:04Z","created_at":"2010-01-20T23:14:12Z","id":481366,"mirror_url":null,"html_url":"https://github.com/nvie/gitflow","full_name":"nvie/gitflow"},"permissions":{"pull":true,"admin":true,"push":true},"master_branch":"develop","homepage":"http://nvie.com/posts/a-successful-git-branching-model/","url":"https://api.github.com/repos/jacquev6/gitflow","has_wiki":true,"has_issues":false,"fork":true,"forks":0,"size":4602,"private":false,"open_issues":0,"svn_url":"https://github.com/jacquev6/gitflow","owner":{"url":"https://api.github.com/users/jacquev6","avatar_url":"https://secure.gravatar.com/avatar/b68de5ae38616c296fa345d2b9df2225?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","gravatar_id":"b68de5ae38616c296fa345d2b9df2225","login":"jacquev6","id":327146},"name":"gitflow","language":"Shell","description":"Git extensions to provide high-level repository operations for Vincent Driessen's branching model.","ssh_url":"git@github.com:jacquev6/gitflow.git","git_url":"git://github.com/jacquev6/gitflow.git","pushed_at":"2012-02-14T13:11:04Z","created_at":"2012-05-26T20:23:35Z","id":4457584,"mirror_url":null,"html_url":"https://github.com/jacquev6/gitflow","full_name":"jacquev6/gitflow"}
@@ -24,9 +24,9 @@ https
POST
api.github.com
None
/repos/jacquev6/PyGithub/forks?org=BeaverSoftware
{'Authorization': 'Basic login_and_password_removed', 'User-Agent': 'PyGithub/Python'}
None
/repos/jacquev6/PyGithub/forks
{'Authorization': 'Basic login_and_password_removed', 'User-Agent': 'PyGithub/Python', 'Content-Type': 'application/json'}
{"organization": "BeaverSoftware"}
202
[('status', '202 Accepted'), ('x-ratelimit-remaining', '4965'), ('content-length', '3681'), ('server', 'nginx/1.0.13'), ('connection', 'keep-alive'), ('x-ratelimit-limit', '5000'), ('etag', '"e4abc3ca2f8a9ccbe868ead57057a0e8"'), ('date', 'Sun, 27 May 2012 05:23:18 GMT'), ('content-type', 'application/json; charset=utf-8')]
{"parent":{"clone_url":"https://github.com/jacquev6/PyGithub.git","has_downloads":true,"watchers":15,"updated_at":"2012-05-27T05:23:18Z","homepage":"http://vincent-jacques.net/PyGithub","url":"https://api.github.com/repos/jacquev6/PyGithub","mirror_url":null,"has_wiki":false,"has_pages":false,"has_issues":true,"fork":false,"forks":3,"git_url":"git://github.com/jacquev6/PyGithub.git","size":348,"private":false,"open_issues":15,"svn_url":"https://github.com/jacquev6/PyGithub","owner":{"url":"https://api.github.com/users/jacquev6","avatar_url":"https://secure.gravatar.com/avatar/b68de5ae38616c296fa345d2b9df2225?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","gravatar_id":"b68de5ae38616c296fa345d2b9df2225","login":"jacquev6","id":327146},"name":"PyGithub","language":"Python","description":"Python library implementing the full Github API v3","ssh_url":"git@github.com:jacquev6/PyGithub.git","pushed_at":"2012-05-26T20:54:13Z","created_at":"2012-02-25T12:53:47Z","id":3544490,"html_url":"https://github.com/jacquev6/PyGithub","full_name":"jacquev6/PyGithub"},"organization":{"url":"https://api.github.com/users/BeaverSoftware","avatar_url":"https://secure.gravatar.com/avatar/d563e337cac2fdc644e2aaaad1e23266?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-orgs.png","gravatar_id":"d563e337cac2fdc644e2aaaad1e23266","login":"BeaverSoftware","id":1424031},"clone_url":"https://github.com/BeaverSoftware/PyGithub.git","has_downloads":true,"watchers":1,"updated_at":"2012-05-27T05:23:18Z","source":{"clone_url":"https://github.com/jacquev6/PyGithub.git","has_downloads":true,"watchers":15,"updated_at":"2012-05-27T05:23:18Z","homepage":"http://vincent-jacques.net/PyGithub","url":"https://api.github.com/repos/jacquev6/PyGithub","mirror_url":null,"has_wiki":false,"has_pages":false,"has_issues":true,"fork":false,"forks":3,"git_url":"git://github.com/jacquev6/PyGithub.git","size":348,"private":false,"open_issues":15,"svn_url":"https://github.com/jacquev6/PyGithub","owner":{"url":"https://api.github.com/users/jacquev6","avatar_url":"https://secure.gravatar.com/avatar/b68de5ae38616c296fa345d2b9df2225?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","gravatar_id":"b68de5ae38616c296fa345d2b9df2225","login":"jacquev6","id":327146},"name":"PyGithub","language":"Python","description":"Python library implementing the full Github API v3","ssh_url":"git@github.com:jacquev6/PyGithub.git","pushed_at":"2012-05-26T20:54:13Z","created_at":"2012-02-25T12:53:47Z","id":3544490,"html_url":"https://github.com/jacquev6/PyGithub","full_name":"jacquev6/PyGithub"},"permissions":{"pull":true,"admin":true,"push":true},"homepage":"http://vincent-jacques.net/PyGithub","url":"https://api.github.com/repos/BeaverSoftware/PyGithub","mirror_url":null,"has_wiki":false,"has_pages":false,"has_issues":false,"fork":true,"forks":0,"git_url":"git://github.com/BeaverSoftware/PyGithub.git","size":348,"private":false,"open_issues":0,"svn_url":"https://github.com/BeaverSoftware/PyGithub","owner":{"url":"https://api.github.com/users/BeaverSoftware","avatar_url":"https://secure.gravatar.com/avatar/d563e337cac2fdc644e2aaaad1e23266?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-orgs.png","gravatar_id":"d563e337cac2fdc644e2aaaad1e23266","login":"BeaverSoftware","id":1424031},"name":"PyGithub","language":"Python","description":"Python library implementing the full Github API v3","ssh_url":"git@github.com:BeaverSoftware/PyGithub.git","pushed_at":"2012-05-26T20:54:13Z","created_at":"2012-05-27T05:23:17Z","id":4460027,"html_url":"https://github.com/BeaverSoftware/PyGithub","full_name":"BeaverSoftware/PyGithub"}