Skip to content

Commit 722b7d0

Browse files
committed
Remove testing attempt
1 parent 35f6084 commit 722b7d0

File tree

1 file changed

+3
-40
lines changed

1 file changed

+3
-40
lines changed

src/remote.rs

+3-40
Original file line numberDiff line numberDiff line change
@@ -541,6 +541,9 @@ impl<'cb> FetchOptions<'cb> {
541541
}
542542

543543
/// Set fetch depth, a value less or equal to 0 is interpreted as pull everything (effectively the same as not declaring a limit depth)
544+
545+
// FIXME(blyxyas): We currently don't have a test for shallow functions
546+
// because libgit2 doesn't support local shallow clones. https://github.com/rust-lang/git2-rs/pull/979#issuecomment-1716299900
544547
pub fn depth(&mut self, depth: i32) -> &mut Self {
545548
if depth.is_negative() {
546549
self.depth = 0;
@@ -756,7 +759,6 @@ impl RemoteRedirect {
756759

757760
#[cfg(test)]
758761
mod tests {
759-
use crate::build::RepoBuilder;
760762
use crate::{AutotagOption, PushOptions};
761763
use crate::{Direction, FetchOptions, Remote, RemoteCallbacks, Repository};
762764
use std::cell::Cell;
@@ -1120,43 +1122,4 @@ mod tests {
11201122
assert_eq!(flag, 7);
11211123
assert_eq!(remote_repo.branches(None).unwrap().count(), 3);
11221124
}
1123-
1124-
#[test]
1125-
fn shallow_clone() {
1126-
let (td, repo) = crate::test::repo_init();
1127-
1128-
let commit = repo.head().unwrap().target().unwrap();
1129-
let first_commit = repo.find_commit(commit).unwrap();
1130-
1131-
let sig = repo.signature().unwrap();
1132-
let mut index = repo.index().unwrap();
1133-
let tree = index.write_tree().unwrap();
1134-
let tree = repo.find_tree(tree).unwrap();
1135-
1136-
let second_commit = repo.commit(
1137-
Some("HEAD"),
1138-
&sig,
1139-
&sig,
1140-
"second commit",
1141-
&tree,
1142-
&[&first_commit]
1143-
).unwrap();
1144-
1145-
let td2 = TempDir::new().unwrap();
1146-
let mut fo = FetchOptions::new();
1147-
fo.depth(1);
1148-
1149-
let new_repo = RepoBuilder::new()
1150-
.fetch_options(fo)
1151-
.clone(&td.into_path().as_os_str().to_str().unwrap(), td2.path())
1152-
.unwrap();
1153-
1154-
dbg!(new_repo.is_shallow());
1155-
1156-
let _ = dbg!(new_repo.find_commit(first_commit.id())); // ????
1157-
let _ = dbg!(new_repo.find_commit(second_commit));
1158-
1159-
// Check that there's only one commit
1160-
panic!();
1161-
}
11621125
}

0 commit comments

Comments
 (0)