pub struct IndexLock { /* private fields */ }Expand description
Exclusive .git/index.lock held for a mutating porcelain operation.
Acquire with Self::acquire before changing the working tree; persist the index with
IndexHandle::commit_update or
IndexHandle::write, then release on drop when
uncommitted.
Implementations§
Source§impl IndexLock
impl IndexLock
Sourcepub fn acquire(index_path: &Path, config: Option<&ConfigSet>) -> Result<Self>
pub fn acquire(index_path: &Path, config: Option<&ConfigSet>) -> Result<Self>
Create .git/index.lock exclusively, failing when another process holds it.
§Errors
Returns Error::LockHeld (with the pid sidecar’s LockHolder
when one was written) when index.lock already exists after the
core.filesRefLockTimeout budget, or Error::Io for other filesystem failures.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for IndexLock
impl RefUnwindSafe for IndexLock
impl Send for IndexLock
impl Sync for IndexLock
impl Unpin for IndexLock
impl UnsafeUnpin for IndexLock
impl UnwindSafe for IndexLock
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more