We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 727d73f commit a3eae1eCopy full SHA for a3eae1e
src/repo.rs
@@ -1012,6 +1012,11 @@ impl Repository {
1012
///
1013
/// If a custom index has not been set, the default index for the repository
1014
/// will be returned (the one located in .git/index).
1015
+ ///
1016
+ /// **Caution**: If the [`Repository`] of this index is dropped, then this
1017
+ /// [`Index`] will become detached, and most methods on it will fail. See
1018
+ /// [`Index::open`]. Be sure the repository has a binding such as a local
1019
+ /// variable to keep it alive at least as long as the index.
1020
pub fn index(&self) -> Result<Index, Error> {
1021
let mut raw = ptr::null_mut();
1022
unsafe {
0 commit comments