Skip to content

test: pin /read-only + /add promotion of an outside image (#5620) - #1

Merged
Totoro-qaq merged 1 commit into
Totoro-qaq:codex/fix-absolute-path-repo-checkfrom
impartshadow:test/issue-5620-add-route
Sep 5, 2026
Merged

test: pin /read-only + /add promotion of an outside image (#5620)#1
Totoro-qaq merged 1 commit into
Totoro-qaq:codex/fix-absolute-path-repo-checkfrom
impartshadow:test/issue-5620-add-route

Conversation

@impartshadow

Copy link
Copy Markdown

Test-only PR for Aider-AI#5620 as invited in Aider-AI#5620 (comment), targeting codex/fix-absolute-path-repo-check so it can ride along with Aider-AI#5628.

Adds tests/basic/test_issue_5620_add_route.py, which pins the second entry route to the crash: /read-only <outside>/outside.png (allowed from anywhere for images) followed by /add on the same file. On upstream main (5dc9490) the promotion branch in cmd_add calls path_in_repo() with an out-of-root absolute path and the session dies with ValueError: ... is not in the subpath of .... With this branch's path_in_repo() guard the file is reported as not part of the repository and stays read-only.

Verified locally on Linux / Python 3.12:

  • on main without the guard: 1 failed (the ValueError traceback above)
  • on this branch: 1 passed

No source changes; it complements the path_in_repo/is_dirty test already in this branch rather than duplicating it.

)

An image outside the repository is accepted by /read-only from anywhere.
Promoting it with /add reaches GitRepo.path_in_repo() with an out-of-root
absolute path, which raised ValueError on main and killed the session.
With the path_in_repo() guard from this branch it is answered as
'not part of the repository' instead. Fails without the guard, passes with it.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants