Repository navigation
Conversation
…users Repositories::edit() sent every parameter that was not given with its default, so renaming a repository cleared its description, disabled issues and the wiki and made a private repository public. Users::edit() cleared every profile field that was not passed, and Repositories::create() sent team_id 0 and empty values instead of letting GitHub apply its defaults. Default the optional parameters to null and send only the values that are given, as Issues::edit() and Pulls::edit() already do. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary of Changes
Repositories::edit($owner, $repo, $name)always sentdescription='',homepage='',private=false,has_issues=false,has_wiki=false,has_downloads=falseanddefault_branch=''. A plain rename therefore wiped the description, disabled issues and the wiki, and turned a private repository public.Users::edit()likewise sent''for every profile field that was not passed, clearing name, blog, company, bio and so on.Repositories::create()sentteam_id: 0and empty values instead of leaving GitHub's defaults in place.The optional parameters of these three methods now default to
null, and only non-null values are sent — the patternIssues::edit()andPulls::edit()already use. Values passed explicitly (including''andfalse) are still sent, so callers that deliberately clear a field keep working.This is technically a behaviour change in 4.x, but no caller can reasonably rely on the data loss.
Testing Instructions
RepositoriesTest::testCreate,testCreateWithOrgandtestEditnow expect only the given values;RepositoriesTest::testEditSendsOnlyGivenValuesandUsersTest::testEditSendsOnlyGivenValuescover partial edits with named arguments. All five fail before the change.Documentation Changes Required
docs/overview.md: new section "Creating and editing repositories and the user profile".🤖 Generated with Claude Code