History

validate default remote name as well and show minimal clone without worktree

Sebastian Thiel committed 4 years ago

Commit dff66e81 parent 3865aea1 file · +12 −3Browse files

Unified · Split

git-repository/tests/clone/mod.rs+12−3
@@ -1,7 +1,5 @@
11 use crate::remote;
2−use git_odb::Find;
32 use git_repository as git;
4−use git_repository::remote::fetch::Status;
53
64 #[test]
75 #[cfg(feature = "blocking-network-client")]
@@ -38,8 +36,9 @@ fn fetch_only_with_configuration() -> crate::Result { · 30 unmodified lines
3836
3937 assert_eq!(out.ref_map.mappings.len(), 13);
4038 match out.status {
41− Status::Change { update_refs, .. } => {
39+ git_repository::remote::fetch::Status::Change { update_refs, .. } => {
4240 for edit in &update_refs.edits {
41+ use git_odb::Find;
4342 assert!(
4443 repo.objects.contains(edit.change.new_value().expect("always set").id()),
4544 "part of the fetched pack"
@@ -51,6 +50,16 @@ fn fetch_only_with_configuration() -> crate::Result { · 5 unmodified lines
5150 Ok(())
5251 }
5352
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+
5463 #[test]
5564 fn clone_and_early_persist_without_receive() -> crate::Result {
5665 let tmp = git_testtools::tempfile::TempDir::new()?;

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t