Skip to content

Commit c136329

Browse files
committed
Make it easier to discover is_path_excluded() in documentation
1 parent a5168aa commit c136329

File tree

4 files changed

+8
-0
lines changed

4 files changed

+8
-0
lines changed

gix-worktree/src/stack/platform.rs

+1
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ impl<'a> Platform<'a> {
2020
/// # Panics
2121
///
2222
/// If the cache was configured without exclude patterns.
23+
#[doc(alias = "is_path_ignored", alias = "git2")]
2324
pub fn is_excluded(&self) -> bool {
2425
self.matching_exclude_pattern()
2526
.map_or(false, |m| !m.pattern.is_negative())

gix/src/attribute_stack.rs

+1
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ impl<'repo> AttributeStack<'repo> {
3939
/// path is created as directory. If it's not known it is assumed to be a file.
4040
///
4141
/// Provide access to cached information for that `relative` path via the returned platform.
42+
#[doc(alias = "is_path_ignored", alias = "git2")]
4243
pub fn at_path(
4344
&mut self,
4445
relative: impl AsRef<std::path::Path>,

gix/src/repository/attributes.rs

+1
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,7 @@ impl Repository {
106106
/// When only excludes are desired, this is the most efficient way to obtain them. Otherwise use
107107
/// [`Repository::attributes()`] for accessing both attributes and excludes.
108108
// TODO: test
109+
#[doc(alias = "is_path_ignored", alias = "git2")]
109110
#[cfg(feature = "excludes")]
110111
pub fn excludes(
111112
&self,

gix/src/repository/index.rs

+5
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,11 @@ impl crate::Repository {
4040
/// Return a shared worktree index which is updated automatically if the in-memory snapshot has become stale as the underlying file
4141
/// on disk has changed.
4242
///
43+
/// ### Notes
44+
///
45+
/// * This will fail if the file doesn't exist, like in a newly initialized repository. If that is the case, use
46+
/// [index_or_empty()](Self::index_or_empty) or [try_index()](Self::try_index) instead.
47+
///
4348
/// The index file is shared across all clones of this repository.
4449
pub fn index(&self) -> Result<worktree::Index, worktree::open_index::Error> {
4550
self.try_index().and_then(|opt| match opt {

0 commit comments

Comments
 (0)