1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
use std::path::PathBuf;
#[derive(Debug, PartialOrd, PartialEq, Ord, Eq, Hash, Clone, Copy)]
pub enum WriteReflog {
Normal,
Disable,
}
impl Default for WriteReflog {
fn default() -> Self {
WriteReflog::Normal
}
}
#[derive(Debug, PartialOrd, PartialEq, Ord, Eq, Hash, Clone)]
pub struct Store {
pub base: PathBuf,
pub write_reflog: WriteReflog,
}
pub struct Transaction<'s> {
store: &'s Store,
packed_transaction: Option<crate::store::packed::Transaction>,
updates: Option<Vec<transaction::Edit>>,
packed_refs: transaction::PackedRefs,
namespace: Option<crate::Namespace>,
}
pub(in crate::store::file) fn path_to_name(path: impl Into<PathBuf>) -> bstr::BString {
use os_str_bytes::OsStringBytes;
let path = path.into().into_raw_vec();
#[cfg(windows)]
let path = {
use bstr::ByteSlice;
path.replace(b"\\", b"/")
};
path.into()
}
pub mod loose;
mod overlay;
pub mod iter {
pub use super::{
loose::iter::{loose, Loose},
overlay::LooseThenPacked,
};
pub mod loose_then_packed {
pub use super::super::overlay::Error;
}
}
pub mod log;
pub mod find;
mod reference;
pub use reference::Reference;
pub mod transaction;
pub mod packed;