Skip to content

repo_editor: match .git the way Git does on NTFS - #8483

Merged
unknwon merged 4 commits into
mainfrom
ghsa-hc35-pcqw-5xjq
Nov 11, 2026
Merged

unknwon merged 4 commits into
mainfrom
ghsa-hc35-pcqw-5xjq

Conversation

@unknwon

@unknwon unknwon commented Nov 11, 2026 •

Copy link
Copy Markdown
Member

Describe the pull request

Recognize every name that NTFS resolves to a repository's .git directory when validating tree paths in the web editor, file upload and the contents API. The check now follows is_ntfs_dotgit of Git, which also covers the 8.3 short name and alternate data streams, in addition to the trailing dots and spaces handled by #8408.

Link to the issue: GHSA-hc35-pcqw-5xjq

Checklist

  • I agree to follow the Code of Conduct by submitting this pull request.
  • I have read and acknowledge the Contributing guide.
  • I have added test cases to cover the new code or have provided the test plan. (if applicable)
  • I have added an entry to CHANGELOG. (if applicable)

Test plan

  • go test ./internal/database/ -run TestIsRepositoryGitPath, the new alias cases fail without the fix.
  • Through the web editor, the reported tree paths and their short name variants are rejected with "bad tree path" and nothing is written, while before the fix they were written.
  • Creating, editing with rename, uploading, and deleting files through the web editor still work.

AI usage

Claude Code was used to verify the report, write the fix, and run the end-to-end checks above, all reviewed by the maintainer.

@unknwon unknwon added this to the 0.14.4 milestone Nov 11, 2026
@unknwon unknwon changed the title repo_editor: reject all aliases of .git in tree paths repo_editor: match .git the way Git does on NTFS Nov 11, 2026
@unknwon
unknwon merged commit 4301704 into main Nov 11, 2026
11 checks passed
@unknwon
unknwon deleted the ghsa-hc35-pcqw-5xjq branch November 11, 2026 03:35
unknwon added a commit that referenced this pull request Nov 11, 2026
@unknwon unknwon mentioned this pull request Nov 11, 2026
4 of 6 tasks
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.

1 participant