From 205fd1a765fe967e6d6d732303b126934ef74744 Mon Sep 17 00:00:00 2001 From: Jacob Finkelman Date: Mon, 11 Sep 2023 19:25:45 +0000 Subject: [PATCH] libgit2 fixed upstream --- crates/cargo-test-support/src/git.rs | 19 +------------------ 1 file changed, 1 insertion(+), 18 deletions(-) diff --git a/crates/cargo-test-support/src/git.rs b/crates/cargo-test-support/src/git.rs index ff6f2735fbf..236011ca1c1 100644 --- a/crates/cargo-test-support/src/git.rs +++ b/crates/cargo-test-support/src/git.rs @@ -177,25 +177,8 @@ where /// Add all files in the working directory to the git index. pub fn add(repo: &git2::Repository) { - // FIXME(libgit2/libgit2#2514): apparently, `add_all` will add all submodules - // as well, and then fail because they're directories. As a stop-gap, we just - // ignore all submodules. - let mut s = t!(repo.submodules()); - for submodule in s.iter_mut() { - t!(submodule.add_to_index(false)); - } let mut index = t!(repo.index()); - t!(index.add_all( - ["*"].iter(), - git2::IndexAddOption::DEFAULT, - Some( - &mut (|a, _b| if s.iter().any(|s| a.starts_with(s.path())) { - 1 - } else { - 0 - }) - ) - )); + t!(index.add_all(["*"].iter(), git2::IndexAddOption::DEFAULT, None)); t!(index.write()); }