MCPcopy Index your code
hub / github.com/emwalker/digraph / upsert_topic

Function upsert_topic

backend/tests/git/topic.rs:684–703  ·  view source on GitHub ↗
(repo_1: RepoId, repo_2: RepoId, name: &str)

Source from the content-addressed store, hash-verified

682 }
683
684 fn upsert_topic(repo_1: RepoId, repo_2: RepoId, name: &str) -> Result<UpsertTopicResult> {
685 let f = Fixtures::copy("simple");
686 let topic_id = parse_id("00001");
687
688 let result = f
689 .upsert_topic(repo_1, name, &topic_id, OnMatchingSynonym::Ask)
690 .unwrap();
691 assert!(result.saved);
692 let parent_topic = result.repo_topic.unwrap();
693 let parent_id = parent_topic.topic_id();
694
695 let topic_path = parse_id("00002");
696
697 f.upsert_topic(
698 repo_2,
699 name,
700 &topic_path,
701 OnMatchingSynonym::Update(parent_id.to_owned()),
702 )
703 }
704
705 fn assert_update_works(repo_1: RepoId, repo_2: RepoId, expected_parent_topics: &[&str]) {
706 let result = upsert_topic(repo_1, repo_2, "Topic name").unwrap();

Callers 2

assert_update_worksFunction · 0.85
synonyms_are_dedupedFunction · 0.85

Calls 4

parse_idFunction · 0.85
UpdateClass · 0.85
upsert_topicMethod · 0.45
topic_idMethod · 0.45

Tested by

no test coverage detected