rust-lang / git2-rs

libgit2 bindings for Rust
https://docs.rs/git2
Apache License 2.0
1.64k stars 380 forks source link

Documentation for update_index should be tweaked #967

Open PoignardAzur opened 11 months ago

PoignardAzur commented 11 months ago

Current documentation says this:

/// Prevents checkout from writing the updated files' information to the
/// index.
///
/// Defaults to true.
pub fn update_index(&mut self, update: bool) -> &mut CheckoutBuilder<'cb>;

It's not completely clear when reading this whether setting this flag to true enables writing to the index or inhibits it (though the function and param names point towards the correct interpretation).

A better doc comment might be

When set to false, prevents checkout from writing the updated files' information to the index.