Skip to main content

import_git_repo_persistent

Function import_git_repo_persistent 

Source
pub fn import_git_repo_persistent<S: Store, H: BuildHasher>(
    git_repo: &Repository,
    panproto_store: &mut S,
    revspec: &str,
    known: &HashMap<Oid, ObjectId, H>,
    cache_dir: &Path,
) -> Result<ImportResult, GitBridgeError>
Expand description

Import a git repository, persisting the blob-to-schema cache under cache_dir/<BLOB_CACHE_FILE> so subsequent imports deduplicate unchanged files without re-parsing them.

This is the production entry point: cache_dir is usually the per-remote panproto cache directory ($GIT_DIR/panproto-cache/<remote>/). Pass an empty known map for a full import, or the existing git-to-panproto marks for an incremental one.

§Errors

Returns GitBridgeError if git operations, parsing, or VCS operations fail. The cache file is loaded best-effort; a corrupt cache propagates as GitBridgeError::BlobCache so the caller can choose to delete-and-restart rather than silently re-import.