← 输入框|github.com|刷新
Skip to content

fix: preserve repeated mount names when mapping Docker paths - #3787

Closed
Ghoscro wants to merge 1 commit into
pre-commit:mainfrom
Ghoscro:fix/docker-repeated-mount-path
Closed

Ghoscro wants to merge 1 commit into
pre-commit:mainfrom
Ghoscro:fix/docker-repeated-mount-path

Conversation

@Ghoscro

@Ghoscro Ghoscro commented Oct 23, 2026 •

Copy link
Copy Markdown

When a container working directory repeats its mount destination further down its path, _get_docker_path replaces every occurrence. Mounting /opt/my_code at /project maps /project/cache/project/repo to the incorrect /opt/my_code/cache/opt/my_code/repo.

Replace only the matching mount prefix and add a mocked Docker inspection regression.

Validation: the new regression fails before this fix; afterward 20 Docker helper tests pass. The two real Docker integration tests were not run; the regression uses mocks and needs no Docker daemon.

AI assistance: prepared, reviewed and tested with OpenAI Codex. Source-inspection finding reproduced locally.

Assisted-by: OpenAI GPT-6 <noreply@openai.com>
@asottile asottile closed this Oct 23, 2026
@pre-commit pre-commit locked as spam and limited conversation to collaborators Oct 23, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants