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 @@
1use crate::remote;1use crate::remote;
2use git_odb::Find;
3use git_repository as git;2use git_repository as git;
4use 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")]
55fn 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]
55fn clone_and_early_persist_without_receive() -> crate::Result {64fn clone_and_early_persist_without_receive() -> crate::Result {
56 let tmp = git_testtools::tempfile::TempDir::new()?;65 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