Skip to content

Commit

Permalink
Remove testing attempt
Browse files Browse the repository at this point in the history
  • Loading branch information
blyxyas committed Sep 12, 2023
1 parent 35f6084 commit 4680cd1
Showing 1 changed file with 0 additions and 40 deletions.
40 changes: 0 additions & 40 deletions src/remote.rs
Original file line number Diff line number Diff line change
Expand Up @@ -756,7 +756,6 @@ impl RemoteRedirect {

#[cfg(test)]
mod tests {
use crate::build::RepoBuilder;
use crate::{AutotagOption, PushOptions};
use crate::{Direction, FetchOptions, Remote, RemoteCallbacks, Repository};
use std::cell::Cell;
Expand Down Expand Up @@ -1120,43 +1119,4 @@ mod tests {
assert_eq!(flag, 7);
assert_eq!(remote_repo.branches(None).unwrap().count(), 3);
}

#[test]
fn shallow_clone() {
let (td, repo) = crate::test::repo_init();

let commit = repo.head().unwrap().target().unwrap();
let first_commit = repo.find_commit(commit).unwrap();

let sig = repo.signature().unwrap();
let mut index = repo.index().unwrap();
let tree = index.write_tree().unwrap();
let tree = repo.find_tree(tree).unwrap();

let second_commit = repo.commit(
Some("HEAD"),
&sig,
&sig,
"second commit",
&tree,
&[&first_commit]
).unwrap();

let td2 = TempDir::new().unwrap();
let mut fo = FetchOptions::new();
fo.depth(1);

let new_repo = RepoBuilder::new()
.fetch_options(fo)
.clone(&td.into_path().as_os_str().to_str().unwrap(), td2.path())
.unwrap();

dbg!(new_repo.is_shallow());

let _ = dbg!(new_repo.find_commit(first_commit.id())); // ????
let _ = dbg!(new_repo.find_commit(second_commit));

// Check that there's only one commit
panic!();
}
}

0 comments on commit 4680cd1

Please sign in to comment.