MCPcopy Create free account
hub / github.com/Qovery/engine / test_git_submodule_skipped_when_disabled

Function test_git_submodule_skipped_when_disabled

lib-engine/src/cmd/git.rs:581–600  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

579
580 #[test]
581 fn test_git_submodule_skipped_when_disabled() {
582 // Same repo as test_git_submodule_with_ssh_key: its submodule requires an SSH key.
583 // With skip_submodules, the clone must succeed without any credentials and
584 // the submodule directory must stay empty.
585 let commit_id = "9a9c1f4373c8128151a9def9ea3d838fa2ed33e8";
586 let clone_dir = DirectoryForTests::new_with_random_suffix("/tmp/engine_test_submodule_skip".to_string());
587 let repo = clone_at_commit(
588 &Url::parse("https://github.com/Qovery/engine-testing.git").unwrap(),
589 commit_id,
590 Path::new(&clone_dir.path),
591 &|_| Vec::new(),
592 true,
593 );
594 assert!(repo.is_ok());
595 assert!(!PathBuf::from(format!("{}/dumb-logger/README.md", clone_dir.path())).exists());
596
597 let repo = Repository::open(&clone_dir.path);
598 assert!(repo.is_ok());
599 assert_eq!(repo.unwrap().head().unwrap().target().unwrap().to_string(), commit_id);
600 }
601}

Callers

nothing calls this directly

Calls 1

clone_at_commitFunction · 0.85

Tested by

no test coverage detected