MCPcopy Create free account
hub / github.com/atomicdotdev/atomic / graph_stream_inputs

Method graph_stream_inputs

atomic-cli/src/commands/git/stream.rs:729–762  ·  view source on GitHub ↗
(
        &self,
        tip: Oid,
    )

Source from the content-addressed store, hash-verified

727 }
728
729 fn graph_stream_inputs(
730 &self,
731 tip: Oid,
732 ) -> CliResult<(GitRepository, ConversionPolicy, Vec<Oid>)> {
733 let git = self.open_git_repo()?;
734 if crate::commands::git::import::has_binding_transport(&git)? {
735 return Err(git_error("direct stream does not restore Atomic binding transport; use --no-stream for the ordinary importer"));
736 }
737 if !detect_git_boundaries(&git)?.is_empty() {
738 return Err(git_error(
739 "direct stream refuses shallow/promisor/replacement/graft boundaries",
740 ));
741 }
742 let policy = conversion_policy(&git)?;
743 let ordered = self.collect_commit_oids_from_tip(&git, tip)?;
744 verify_commit_closure_objects_with_shallow(&git, &ordered, &HashSet::new())?;
745 for oid in &ordered {
746 let commit = git
747 .find_commit(*oid)
748 .map_err(|e| git_error(e.to_string()))?;
749 let message = String::from_utf8_lossy(commit.message_bytes());
750 if parse_push_trailer(&message).is_some()
751 || parse_atomic_changes_trailer(&message).is_some()
752 {
753 return Err(git_error("direct stream refuses Atomic provenance/binding claims; use --no-stream for the ordinary importer"));
754 }
755 let tree = commit.tree().map_err(|e| git_error(e.to_string()))?;
756 // Share the ordinary importer's kind/mode validation. The parser
757 // already carries raw Git names through the reversible escape;
758 // there is no stream-specific character or UTF-8 restriction.
759 validate_import_tree_capabilities(&git, &tree, "")?;
760 }
761 Ok((git, policy, ordered))
762 }
763
764 /// Read ahead at most 500 commits and publish up to 100 at a time. Both
765 /// queued input blob reservations and prepared batches have explicit caps.

Calls 12

has_binding_transportFunction · 0.85
detect_git_boundariesFunction · 0.85
conversion_policyFunction · 0.85
parse_push_trailerFunction · 0.85
open_git_repoMethod · 0.80
treeMethod · 0.80
git_errorFunction · 0.70
is_emptyMethod · 0.45