Title: fix(util): preserve separators before relative path tokens by gavenren · Pull Request #2319 · gitpython-developers/GitPython · GitHub
Open Graph Title: fix(util): preserve separators before relative path tokens by gavenren · Pull Request #2319 · gitpython-developers/GitPython
X Title: fix(util): preserve separators before relative path tokens by gavenren · Pull Request #2319 · gitpython-developers/GitPython
Description: The public join_path("parent", "/child") returns parentchild, and chaining slash-prefixed tokens loses each separator. Strip leading slashes from later tokens before the existing join logic. Later tokens still extend the accumulated prefix; they do not replace it. Document this contract and cover strings, PathLike input, chained tokens, roots, empty tokens and repeated leading slashes. This preserves the relative-token intention explained in the earlier #119 discussion. That proposal replaced the accumulated prefix with an absolute token; this patch retains the prefix and fixes the missing seam. Motivation: This work was pursued to build @gavenren's requested portfolio of tested open-source contributions. Inspecting GitPython's public path helpers exposed this reproducible case. Validation (Linux, Python 3.12.14, Git 2.52.0, GixPython 0.3.0): Five of the eleven new parameterized cases fail against unchanged main. test/test_util.py, via test/run-local.py, with each of GIT_PYTHON_BACKEND=cli and gix: 128 passed, 39 skipped per backend. Caller modules test_tree.py test_refs.py test_remote.py, through the same runner with both backends: 230 passed, seven failed per backend. The identical seven test_timeout_stalled_remote cases fail on an unchanged-base worktree with both backends (seven failed, two passed in the isolated timeout selection). These failures concern the test's three-second timeout-cleanup bound; their root cause has not been established here. Repository pre-commit run --files git/util.py test/test_util.py: passed all applicable hooks, including Ruff check/format. git diff --check: passed. Full suites and other platforms were not run. Agent identification: This PR, implementation, tests, commit and description were prepared autonomously by OpenAI Codex in ChatGPT Work Mode, communicating through @gavenren's account. The exact underlying model and reasoning setting are unavailable. No human review, approval or manual testing is claimed.
Open Graph Description: The public join_path("parent", "/child") returns parentchild, and chaining slash-prefixed tokens loses each separator. Strip leading slashes from later tokens before the existin...
X Description: The public join_path("parent", "/child") returns parentchild, and chaining slash-prefixed tokens loses each separator. Strip leading slashes from later tokens be...
Opengraph URL: https://github.com/gitpython-developers/GitPython/pull/2319
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:883941fa-c653-7dca-a927-0f6311e2e704 |
| current-catalog-service-hash | ae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b |
| request-id | D474:19AA62:3B7533:4D2619:6B00D32F |
| html-safe-nonce | 3782144e5eb5cda126cc5a6a2daef5184f396d9aed2677b68ed702fc26fff244 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJENDc0OjE5QUE2MjozQjc1MzM6NEQyNjE5OjZCMDBEMzJGIiwidmlzaXRvcl9pZCI6IjE2ODk3MDkxOTQ4MjA3Njg1NTkiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | a93aaec3b13f8346c8ed7e75ff54938ebda23e1f08cde38d4df47a522620d551 |
| hovercard-subject-tag | pull_request:5054892096 |
| 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/2319/files |
| twitter:image | https://avatars.githubusercontent.com/u/206281466?s=400&v=4 |
| twitter:card | summary_large_image |
| og:image | https://avatars.githubusercontent.com/u/206281466?s=400&v=4 |
| og:image:alt | The public join_path("parent", "/child") returns parentchild, and chaining slash-prefixed tokens loses each separator. Strip leading slashes from later tokens before the existin... |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | 85bbdfe2b6ba16e234513bc6ceff5d848ef8449820c900692a2b4e67061931e5 |
| 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 | 4943239a6d2c591325dad6e5c313e1cafda877f6 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width