mirror of
https://github.com/rust-lang/cargo.git
synced 2025-10-01 11:30:39 +00:00
assure user and system configuration for .gitignore/exclude files is picked up
This commit is contained in:
parent
acef08407b
commit
8375cf40ee
@ -263,11 +263,7 @@ impl<'gctx> PathSource<'gctx> {
|
|||||||
/// Returns [`Some(gix::Repository)`](gix::Repository) if there is a sibling `Cargo.toml` and `.git`
|
/// Returns [`Some(gix::Repository)`](gix::Repository) if there is a sibling `Cargo.toml` and `.git`
|
||||||
/// directory; otherwise, the caller should fall back on full file list.
|
/// directory; otherwise, the caller should fall back on full file list.
|
||||||
fn discover_gix_repo(&self, root: &Path) -> CargoResult<Option<gix::Repository>> {
|
fn discover_gix_repo(&self, root: &Path) -> CargoResult<Option<gix::Repository>> {
|
||||||
let mut mapping = gix::sec::trust::Mapping::default();
|
let repo = match gix::ThreadSafeRepository::discover(root) {
|
||||||
mapping.full = gix::open::Options::isolated();
|
|
||||||
mapping.reduced = gix::open::Options::isolated();
|
|
||||||
let repo = match gix::ThreadSafeRepository::discover_opts(root, Default::default(), mapping)
|
|
||||||
{
|
|
||||||
Ok(repo) => repo.to_thread_local(),
|
Ok(repo) => repo.to_thread_local(),
|
||||||
Err(e) => {
|
Err(e) => {
|
||||||
tracing::debug!(
|
tracing::debug!(
|
||||||
@ -597,7 +593,7 @@ impl<'gctx> PathSource<'gctx> {
|
|||||||
// This could be a submodule, or a sub-repository. In any case, we prefer to walk
|
// This could be a submodule, or a sub-repository. In any case, we prefer to walk
|
||||||
// it with git-support to leverage ignored files and to avoid pulling in entire
|
// it with git-support to leverage ignored files and to avoid pulling in entire
|
||||||
// .git repositories.
|
// .git repositories.
|
||||||
match gix::open_opts(&file_path, gix::open::Options::isolated()) {
|
match gix::open(&file_path) {
|
||||||
Ok(sub_repo) => {
|
Ok(sub_repo) => {
|
||||||
files.extend(self.list_files_gix(pkg, &sub_repo, filter)?);
|
files.extend(self.list_files_gix(pkg, &sub_repo, filter)?);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user