Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

libgit2 fixed upstream #12657

Merged
merged 1 commit into from
Sep 12, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 1 addition & 18 deletions crates/cargo-test-support/src/git.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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());
}

Expand Down