net.git-fetch-with-cli fails with "cannot use bare repository" with safe.bareRepository = explicit
#14758
Labels
A-git
Area: anything dealing with git
C-bug
Category: bug
E-easy
Experience: Easy
S-accepted
Status: Issue or feature is accepted, and has a team member available to help mentor or review
Problem
When using
net.git-fetch-with-cli = true
with a sufficiently new git, it fails to clone the git repository into the cache becausesafe.bareRepository
defaults toexplicit
.With
Cargo.toml
:I get
This is likely due to the mitigation for https://github.com/justinsteven/advisories/blob/main/2022_git_buried_bare_repos_and_fsmonitor_various_abuses.md
Steps
net.git-fetch-with-cli = true
cargo update
(or any other command that will fetch the git repoPossible Solution(s)
It's likely that adding
--git-dir
to the git command line will get around this, since cargo is using bare repositories on purpose.Notes
No response
Version
cargo 1.81.0-nightly (154fdac 2024-07-07)
release: 1.81.0-nightly
commit-hash: 154fdac
commit-date: 2024-07-07
host: x86_64-unknown-linux-gnu
libgit2: 1.8.1 (sys:0.19.0 vendored)
libcurl: 8.8.0-DEV (sys:0.4.73+curl-8.8.0 vendored ssl:OpenSSL/1.1.1w)
ssl: OpenSSL 1.1.1w 11 Sep 2023
os: Debian n/a (rodete) [64-bit]
The text was updated successfully, but these errors were encountered: