]> git.proxmox.com Git - rustc.git/blame - vendor/gix/src/repository/mod.rs
New upstream version 1.72.1+dfsg1
[rustc.git] / vendor / gix / src / repository / mod.rs
CommitLineData
0a29b90c
FG
1//!
2
fe692bf9
FG
3/// The kind of repository.
4#[derive(Debug, Clone, Copy, Eq, PartialEq, Ord, PartialOrd, Hash)]
5pub enum Kind {
6 /// A submodule worktree, whose `git` repository lives in `.git/modules/**/<name>` of the parent repository.
7 Submodule,
8 /// A bare repository does not have a work tree, that is files on disk beyond the `git` repository itself.
9 Bare,
10 /// A `git` repository along with a checked out files in a work tree.
11 WorkTree {
12 /// If true, this is the git dir associated with this _linked_ worktree, otherwise it is a repository with _main_ worktree.
13 is_linked: bool,
14 },
15}
16
0a29b90c
FG
17/// Internal
18impl crate::Repository {
19 #[inline]
20 pub(crate) fn free_buf(&self) -> Vec<u8> {
21 self.bufs.borrow_mut().pop().unwrap_or_default()
22 }
23
24 /// This method is commonly called from the destructor of objects that previously claimed an entry
25 /// in the free-list with `free_buf()`.
26 /// They are welcome to take out the data themselves, for instance when the object is detached, to avoid
27 /// it to be reclaimed.
28 #[inline]
29 pub(crate) fn reuse_buffer(&self, data: &mut Vec<u8>) {
30 if data.capacity() > 0 {
31 self.bufs.borrow_mut().push(std::mem::take(data));
32 }
33 }
34}
35
49aad941 36mod attributes;
0a29b90c
FG
37mod cache;
38mod config;
49aad941 39mod excludes;
fe692bf9 40mod graph;
0a29b90c
FG
41pub(crate) mod identity;
42mod impls;
43mod init;
fe692bf9 44mod kind;
0a29b90c
FG
45mod location;
46mod object;
0a29b90c
FG
47mod reference;
48mod remote;
49mod revision;
49aad941 50mod shallow;
0a29b90c
FG
51mod snapshots;
52mod state;
53mod thread_safe;
54mod worktree;