mirror of
https://seed.radicle.dev/rad:z6cFWeWpnZNHh9rUW8phgA3b5yGt.git
synced 2026-10-18 19:10:31 +08:00
Fixes requesting a directory containing another directory with [brackets] in its name disable_pathspec_match(true) sets the GIT_DIFF_DISABLE_PATHSPEC_MATCH flag on libgit2's diff options. Normally, pathspecs are matched using fnmatch/glob pattern matching, where [ starts a character class, * and ? are wildcards, and \ is the escape character. With this flag, pathspecs are treated as literal strings with prefix matching for directories. So src/[something] matches exactly src/[something] and any files under it, rather than [something] being interpreted as a glob character class matching a single character from the set s, o, m, e, etc. Removing escaped_name is OK because the old escaped_name doubled backslashes(\ -> \\) specifically because pathspecs used glob/fnmatch interpretation, where \ is the escape character. The doubling made pathspec where \ is the escape character. The doubling made pathspec treat \\ as "match a literal \". With disable_pathspec_match(true), there's no glob interpretation at all, so \ is already treated literally. The doubling is no longer needed and would actually break things (pathspec would look for \\ instead of \). Regarding Windows, escaped_name has no impact on Windows behavior. On Windows, \ is the path separator and cannot appear in filenames, so escaped_name was effectively a no-op on Windows anyway. The existing test for backslash filenames (special/faux\path) is already gated with `#[cfg(not(windows))]` since such filenames only exist on Unix. So removing escaped_name has no impact on Windows behavior.
radicle-surf
A code surfing library for Git repositories 🏄♀️🏄♂️
Welcome to radicle-surf!
radicle-surf is a library to describe a Git repository as a file system. It
aims to provide an easy-to-use API to browse a repository via the concept of
files and directories for any given revision. It also allows the user to diff
any two different revisions.
One of the use cases would be to create a web GUI for interacting with a Git repository (thinking GitHub, GitLab or similar systems).
Contributing
To get started on contributing you can check out our developing guide, and also our LICENSE file.
The Community
Join our community disccussions at radicle.community!