Unified · Split
| @@ -1,7 +1,5 @@ | |||
| 1 | use crate::remote; | 1 | use crate::remote; |
| 2 | use git_odb::Find; | ||
| 3 | use git_repository as git; | 2 | use git_repository as git; |
| 4 | use git_repository::remote::fetch::Status; | ||
| 5 | 3 | ||
| 6 | #[test] | 4 | #[test] |
| 7 | #[cfg(feature = "blocking-network-client")] | 5 | #[cfg(feature = "blocking-network-client")] |
| @@ -38,8 +36,9 @@ fn fetch_only_with_configuration() -> crate::Result { · 30 unmodified lines | |||
| 38 | 36 | ||
| 39 | assert_eq!(out.ref_map.mappings.len(), 13); | 37 | assert_eq!(out.ref_map.mappings.len(), 13); |
| 40 | match out.status { | 38 | match out.status { |
| 41 | Status::Change { update_refs, .. } => { | 39 | git_repository::remote::fetch::Status::Change { update_refs, .. } => { |
| 42 | for edit in &update_refs.edits { | 40 | for edit in &update_refs.edits { |
| 41 | use git_odb::Find; | ||
| 43 | assert!( | 42 | assert!( |
| 44 | repo.objects.contains(edit.change.new_value().expect("always set").id()), | 43 | repo.objects.contains(edit.change.new_value().expect("always set").id()), |
| 45 | "part of the fetched pack" | 44 | "part of the fetched pack" |
| @@ -51,6 +50,16 @@ fn fetch_only_with_configuration() -> crate::Result { · 5 unmodified lines | |||
| 51 | Ok(()) | 50 | Ok(()) |
| 52 | } | 51 | } |
| 53 | 52 | ||
| 53 | #[test] | ||
| 54 | #[cfg(feature = "blocking-network-client")] | ||
| 55 | fn fetch_only_without_configuration() -> crate::Result { | ||
| 56 | let tmp = git_testtools::tempfile::TempDir::new()?; | ||
| 57 | let (repo, _out) = git::prepare_clone_bare(remote::repo("base").path(), tmp.path())? | ||
| 58 | .fetch_only(git::progress::Discard, &std::sync::atomic::AtomicBool::default())?; | ||
| 59 | assert!(repo.find_remote("origin").is_ok(), "default remote name is 'origin'"); | ||
| 60 | Ok(()) | ||
| 61 | } | ||
| 62 | |||
| 54 | #[test] | 63 | #[test] |
| 55 | fn clone_and_early_persist_without_receive() -> crate::Result { | 64 | fn clone_and_early_persist_without_receive() -> crate::Result { |
| 56 | let tmp = git_testtools::tempfile::TempDir::new()?; | 65 | let tmp = git_testtools::tempfile::TempDir::new()?; |