Title: fix(index): accept a single PathLike in checkout by kokotatan · Pull Request #2269 · gitpython-developers/GitPython · GitHub
Open Graph Title: fix(index): accept a single PathLike in checkout by kokotatan · Pull Request #2269 · gitpython-developers/GitPython
X Title: fix(index): accept a single PathLike in checkout by kokotatan · Pull Request #2269 · gitpython-developers/GitPython
Description: AI agent disclosure: I am OpenAI GPT-6, submitting this contribution through kokotatan with the account owner's authorization. The independent review was also performed by an AI agent; no human review is claimed. repo.index.checkout(Path("tracked.txt")) raises TypeError: 'WindowsPath' object is not iterable (likewise PosixPath), although the docstring accepts a single path and the same Path works inside a list. Wrap a single os.PathLike just as a single string is already wrapped, and update the public annotation to match. Path normalization, returned strings, and iterable inputs retain their existing behavior. The regression tests create real repositories and restore removed files. The 36-case matrix covers strings, pathlib.Path, and custom __fspath__ objects; relative and absolute paths; files and directories; and single, list, and iterator inputs. Before the fix, eight single-PathLike cases failed and the other 28 passed. Validation on Windows / Python 3.13: Focused checkout regressions plus the existing index tree comparison: 37 passed. Full suite, including performance tests, after init-tests-after-clone.sh and fetching full history: 1,410 passed, 83 skipped, 10 xfailed, and 60 subtests passed; 121 failed because creating symlinks requires a Windows privilege unavailable on this host (WinError 1314). All 121 failing node IDs were reproduced in a separate pristine checkout of the same base commit using the affected test groups; there were no additional failures with this patch. All pre-commit hooks passed, mypy passed (46 source files), basedpyright reported zero errors/warnings, and the Sphinx HTML build passed with warnings treated as errors. Duplicate searches for checkout with PathLike/pathlib found no equivalent open fix. The implementation follows the single-path handling already used by IndexFile.add() and remove().
Open Graph Description: AI agent disclosure: I am OpenAI GPT-6, submitting this contribution through kokotatan with the account owner's authorization. The independent review was also performed by an AI agent; no human...
X Description: AI agent disclosure: I am OpenAI GPT-6, submitting this contribution through kokotatan with the account owner's authorization. The independent review was also performed by an AI agent; no h...
Opengraph URL: https://github.com/gitpython-developers/GitPython/pull/2269
X: @github
Domain: github.com
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /:user_id/:repository/pull/:id/files(.:format) |
| route-controller | pull_requests |
| route-action | files |
| fetch-nonce | v2:6c1f8b22-a8e1-f8c4-5b5b-2fca8fcc92a2 |
| current-catalog-service-hash | ae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b |
| request-id | BB24:4BB79:C54856:FCE7F6:6B0100D6 |
| html-safe-nonce | 289c206d921c736bb9942f0309eb57da743dca4a151441a4d18698791c9a0cba |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCQjI0OjRCQjc5OkM1NDg1NjpGQ0U3RjY6NkIwMTAwRDYiLCJ2aXNpdG9yX2lkIjoiMTExMjg3MTUyMDQ4MjQyNzA5NCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 5d6aa0f73d4cdf7158eef391125850651eab07f81c42c02ee1e6f27227527e17 |
| hovercard-subject-tag | pull_request:4727378010 |
| github-keyboard-shortcuts | repository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/gitpython-developers/GitPython/pull/2269/files |
| twitter:image | https://avatars.githubusercontent.com/u/199421981?s=400&v=4 |
| twitter:card | summary_large_image |
| og:image | https://avatars.githubusercontent.com/u/199421981?s=400&v=4 |
| og:image:alt | AI agent disclosure: I am OpenAI GPT-6, submitting this contribution through kokotatan with the account owner's authorization. The independent review was also performed by an AI agent; no human... |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | cb7fa109eca7d4156c889f474306b0e91336055e9adf8fd4684b61e49094d124 |
| turbo-cache-control | no-preview |
| diff-view | unified |
| go-import | github.com/gitpython-developers/GitPython git https://github.com/gitpython-developers/GitPython.git |
| octolytics-dimension-user_id | 503709 |
| octolytics-dimension-user_login | gitpython-developers |
| octolytics-dimension-repository_id | 1126087 |
| octolytics-dimension-repository_nwo | gitpython-developers/GitPython |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 1126087 |
| octolytics-dimension-repository_network_root_nwo | gitpython-developers/GitPython |
| turbo-body-classes | logged-out env-production page-responsive full-width |
| disable-turbo | true |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 2b59d31a4e44f08b7af67a4b67f8fd0af3befe2a |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width