Begin span-backed streaming into a fresh, untracked repository.
(
repo: &'a mut Repository,
limits: GitStreamLimits,
)
| 532 | |
| 533 | /// Begin span-backed streaming into a fresh, untracked repository. |
| 534 | pub fn begin_span( |
| 535 | repo: &'a mut Repository, |
| 536 | limits: GitStreamLimits, |
| 537 | ) -> Result<Self, RepositoryError> { |
| 538 | use atomic_core::pristine::TreeTxnT; |
| 539 | let working_copy = repo.require_working_copy_id()?; |
| 540 | let _lock = repo.try_lock_operation(working_copy)?; |
| 541 | { |
| 542 | let txn = repo.pristine.read_txn()?; |
| 543 | let first = txn.iter_tree()?.next().transpose()?; |
| 544 | if let Some((path, _)) = first { |
| 545 | return Err(invalid(format!( |
| 546 | "span stream requires a fresh repository without tracked or staged paths; found '{path}'" |
| 547 | ))); |
| 548 | } |
| 549 | } |
| 550 | let mut session = Self::begin(repo, limits)?; |
| 551 | session |
| 552 | .repo |
| 553 | .pristine |
| 554 | .require_repository_capability(atomic_core::pristine::SPAN_RANGE_CAPABILITY)?; |
| 555 | session.span_mode = true; |
| 556 | Ok(session) |
| 557 | } |
| 558 | |
| 559 | /// Continue a direct span stream over an unchanged imported prefix, |
| 560 | /// optionally retaining its native `.atomicignore` bootstrap change. |
nothing calls this directly
no test coverage detected