Skip to content

Commit

Permalink
improve docs to better clarify the locking behaviour and implications (
Browse files Browse the repository at this point in the history
  • Loading branch information
Byron committed Aug 1, 2023
1 parent 7b8683e commit 4919cb2
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,17 @@ use std::path::{Path, PathBuf};
///
/// Uses a "bare" git index that fetches files directly from the repo instead of local checkout.
/// Uses Cargo's cache.
///
/// ### Instantiation
///
/// When creating an instance of this type, the crates-index will be cloned automatically should it not
/// be present. If a repository is present at the location but the remote doesn't match the desired index URL,
/// a new remote will be added and fetched from.
///
/// Please note that concurrent calls to [`GitIndex::new_cargo_default()`] (and related) will automatically block
/// and wait for each other, so only one instance will try to clone the index while the others will wait for completion.
///
/// This, however, only protects from itself and `cargo` cloning the index at the same time might interfere.
#[cfg(feature = "git")]
pub struct GitIndex {
path: std::path::PathBuf,
Expand Down

0 comments on commit 4919cb2

Please sign in to comment.