Skip to content

Commit

Permalink
Update documentation on locking (#35)
Browse files Browse the repository at this point in the history
### Checklist

* [x] I have read the [Contributor Guide](../../CONTRIBUTING.md)
* [x] I have read and agree to the [Code of
Conduct](../../CODE_OF_CONDUCT.md)
* [x] I have added a description of my changes and why I'd like them
included in the section below

### Description of Changes

Updates documentation on locking to match the current, much improved
behavior.
  • Loading branch information
Shnatsel committed Sep 30, 2023
1 parent 1092c66 commit 73c5e8a
Showing 1 changed file with 0 additions and 13 deletions.
13 changes: 0 additions & 13 deletions src/index/git_remote.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,6 @@ impl RemoteGitIndex {
///
/// Note that if a repository does not exist at the local disk path of the
/// provided [`GitIndex`], a full clone will be performed.
///
/// ## Locking
/// This function will wait to aquire the lock on the local directory for up to 10 minutes,
/// and then return `GitError::Lock` if it is still locked by another thread or process.
/// You can customize this behavior using [`Self::with_options`].
///
/// Regardless of the timeout, this function relies on `panic = unwind` to avoid leaving stale locks
/// if the process is interrupted with Ctrl+C. To support `panic = abort` you also need to register
/// the `gix` signal handler to clean up the locks, see [`gix::interrupt::init_handler`].
#[inline]
pub fn new(index: GitIndex, lock: &FileLock) -> Result<Self, Error> {
Self::with_options(
Expand All @@ -50,10 +41,6 @@ impl RemoteGitIndex {
/// Creates a new [`Self`] that allows showing of progress of the the potential
/// fetch if the disk location is empty, as well as allowing interruption
/// of the fetch operation.
///
/// Regardless of the `lock_policy`, this function relies on `panic = unwind` to avoid leaving stale locks
/// if the process is interrupted with Ctrl+C. To support `panic = abort` you also need to register
/// a signal handler that sets `should_interrupt` to `true`.
pub fn with_options<P>(
mut index: GitIndex,
progress: P,
Expand Down

0 comments on commit 73c5e8a

Please sign in to comment.