Reuse the resolved GitHub repository path after a redirect - #1776
Open
be-student wants to merge 2 commits into
Open
Reuse the resolved GitHub repository path after a redirect#1776be-student wants to merge 2 commits into
be-student wants to merge 2 commits into
Conversation
PawelLipski
reviewed
Sep 8, 2026
|
|
||
| Create, check out and manage GitHub PRs while keeping them reflected in branch layout file. | ||
|
|
||
| If GitHub redirects a REST API mutation after a repository rename, git-machete resolves its new location. |
Collaborator
There was a problem hiding this comment.
This is an implementation detail, I'd skip it from the docs TBH
4 tasks
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.
Fixes #1211.
After a renamed repository redirects the first mutation, later REST API calls still use the old repository path and incur another redirect. Retain the resolved organization/repository path in the GitHub API instance after the redirected request succeeds, and reuse it through the shared repository request helper.
Regression tests cover repository renames and organization transfers, the exact redirect/request sequence, subsequent PATCH/POST/GET calls, preserved mutation data, and isolation between API instances. Document the behavior and regenerate the command help and man page. Git remotes remain user-configured; GitLab's separate moved-project error (#1212) is outside this change.
Validation: the new cases fail before the fix; all 48 tests in the GitHub API, PR creation, and retargeting modules pass through tox. The two regressions also pass after adjusting mock inspection for supported older Python versions. Tox formatting, isort, mypy, generated-help consistency, Sphinx HTML/man, and repository static checks pass. Optional remark link checking was skipped because remark is unavailable; flake8/vulture are left to CI per AGENTS.md.