pub enum Kind {
PossiblyBare,
WorkTree {
linked_git_dir: Option<PathBuf>,
},
WorkTreeGitDir {
work_dir: PathBuf,
},
Submodule {
git_dir: PathBuf,
},
SubmoduleGitDir,
}
Expand description
The kind of repository path.
A bare repository does not have a work tree, that is files on disk beyond the git
repository itself.
Note that this is merely a guess at this point as we didn’t read the configuration yet.
Also note that due to optimizing for performance and just making an educated guess in some situations,
we may consider a non-bare repository bare if it doesn’t have an index yet due to be freshly initialized.
The caller has to handle this, typically by reading the configuration.
It could also be a directory which is non-bare by configuration, but is not named .git
.
Unusual, but it’s possible that a worktree is configured via core.worktree
.
A git
repository along with checked out files in a work tree.
Fields
If set, this is the git dir associated with this linked worktree.
If None
, the git_dir is the .git
directory inside the main worktree we represent.
A worktree’s git directory in the common.git
directory in worktrees/<name>
.
Fields
Path to the worktree directory.
The directory is a .git
dir file of a submodule worktree.
Fields
The git repository itself that is referenced by the .git
dir file, typically in the .git/modules/**/<name>
directory of the parent
repository.
The git directory in the .git/modules/**/<name>
directory tree of the parent repository
Returns true if this is a bare repository, one without a work tree.
Performs copy-assignment from
source
.
Read more
Formats the value using the given formatter.
Read more
Compares and returns the maximum of two values.
Read more
Compares and returns the minimum of two values.
Read more
Restrict a value to a certain interval.
Read more
Tests for self
and other
values to be equal, and is used by ==
.
Tests for !=
. The default implementation is almost always sufficient,
and should not be overridden without very good reason.
This method returns an ordering between
self
and
other
values if one exists.
Read more
Tests less than (for
self
and
other
) and is used by the
<
operator.
Read more
Tests less than or equal to (for
self
and
other
) and is used by the
<=
operator.
Read more
Tests greater than (for
self
and
other
) and is used by the
>
operator.
Read more
Tests greater than or equal to (for
self
and
other
) and is used by
the
>=
operator.
Read more
Immutably borrows from an owned value.
Read more
Mutably borrows from an owned value.
Read more
🔬This is a nightly-only experimental API. (clone_to_uninit
)
Performs copy-assignment from
self
to
dst
.
Read more
Returns the argument unchanged.
Calls U::from(self)
.
That is, this conversion is whatever the implementation of
From<T> for U
chooses to do.
The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning.
Read more
Uses borrowed data to replace owned data, usually by cloning.
Read more
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.