Skip to content

Commit 7541cc7

Browse files
committed
Auto merge of #12657 - Eh2406:fixme, r=epage
libgit2 fixed upstream ### What does this PR try to resolve? This "FIXME" points to libgit2/libgit2#2514 witch has bean fixed for... 8 years. So maybe it is no longer needed. ### How should we test and review this PR? By adding panic messages I was able to demonstrate that there were tests hitting this code path. Then I removed the "FIXME" and had the test still pass.
2 parents bef47cb + 205fd1a commit 7541cc7

File tree

1 file changed

+1
-18
lines changed
  • crates/cargo-test-support/src

1 file changed

+1
-18
lines changed

crates/cargo-test-support/src/git.rs

Lines changed: 1 addition & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -177,25 +177,8 @@ where
177177

178178
/// Add all files in the working directory to the git index.
179179
pub fn add(repo: &git2::Repository) {
180-
// FIXME(libgit2/libgit2#2514): apparently, `add_all` will add all submodules
181-
// as well, and then fail because they're directories. As a stop-gap, we just
182-
// ignore all submodules.
183-
let mut s = t!(repo.submodules());
184-
for submodule in s.iter_mut() {
185-
t!(submodule.add_to_index(false));
186-
}
187180
let mut index = t!(repo.index());
188-
t!(index.add_all(
189-
["*"].iter(),
190-
git2::IndexAddOption::DEFAULT,
191-
Some(
192-
&mut (|a, _b| if s.iter().any(|s| a.starts_with(s.path())) {
193-
1
194-
} else {
195-
0
196-
})
197-
)
198-
));
181+
t!(index.add_all(["*"].iter(), git2::IndexAddOption::DEFAULT, None));
199182
t!(index.write());
200183
}
201184

0 commit comments

Comments
 (0)