Tom b479768645 surf: fix patchspec handling for directory names using []
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.
2026-02-18 16:11:47 +00:00
2025-12-08 15:11:21 +00:00
2025-12-08 15:11:21 +00:00
2025-12-08 15:11:21 +00:00
2024-03-13 14:32:14 +00:00
2025-05-23 10:23:47 +01:00
2024-03-06 15:59:57 +00:00
2025-12-08 15:11:21 +00:00
2025-12-08 15:11:21 +00:00
2022-09-15 16:35:47 +01:00
2022-09-15 16:35:47 +01:00
2025-11-14 12:52:22 +01:00
2025-12-08 15:11:21 +00:00
2025-12-08 15:11:21 +00:00
2025-11-14 12:52:22 +01:00
2022-09-15 16:35:47 +01:00
2025-12-08 15:11:21 +00:00

radicle-git

The home for all Git utilities related to Radicle. While the majority of the utilities will attempt to be general, there may be more opinionated parts that are geared towards Radicle.

Motivation

The git2 and gitoxide libraries provide low-level APIs for interacting with git repositories and the git protocol. This family of crates attempts to provide a higher-level wrapper around those to provide a more useful API for the Radicle protocol and UI clients building on top of the protocol.

Overview

The repository is defined as a series of crates:

  • git-ext -- provides higher-level types over common types found in git2.
  • git-ref-format -- provides a higher-level API for constructing git. reference paths. Prefer this over git-ext's RefLike and RefspecPattern.
  • git-trailers -- provides a way to parse and construct git trailers.
  • git-types -- provides higher-level types, e.g. Namespace, Reference, Remote, etc.
  • link-git -- provides a higher-level API for git's refdb, odb, and the git protocol.
  • macros -- provides macros for the git-ext references types.
  • std-ext -- provides some utilities extending the standard library.
  • test -- a shim crate that refers depends on all other, individual test crates.

Tests

Please refer to test/README.md for understanding how our tests are organised.

Contribute

Please read CONTRIBUTING.md for a guide on contributing to this repository.

Credits

Thanks to the previous maintainers of the radicle-link repository, Kim, Alex, and Fintan, for providing the foundation to work upon -- as well as the contributors.

S
Description
Git libraries for Radicle
Readme
1.6 MiB
Languages
Rust 97.3%
Nix 2.1%
Shell 0.6%