History

Fix typos

Kian-Meng Ang committed 4 years ago

Commit e9fcb701 parent aa639d858 files · +73 −73Browse files

Unified · Split

58 files
  1. Cargo.toml +1 −1
  2. DEVELOPMENT.md +1 −1
  3. cargo-smart-release/src/context.rs +1 −1
  4. cargo-smart-release/tests/changelog/parse.rs +1 −1
  5. cargo-smart-release/tests/fixtures/changelog/parse/unknown-known-unknown-known-unsorted.md +1 −1
  6. deny.toml +1 −1
  7. etc/discovery/odb.md +4 −4
  8. git-bitmap/src/ewah.rs +1 −1
  9. git-config/src/file/access/mutate.rs +2 −2
  10. git-config/src/file/includes/mod.rs +1 −1
  11. git-config/src/file/mod.rs +2 −2
  12. git-config/src/parse/events.rs +1 −1
  13. git-diff/src/tree/visit.rs +1 −1
  14. git-diff/tests/fixtures/generated-archives/make_diff_repo.tar.xz +2 −2
  15. git-features/src/parallel/in_parallel.rs +2 −2
  16. git-features/src/parallel/serial.rs +1 −1
  17. git-mailmap/src/entry.rs +1 −1
  18. git-mailmap/src/lib.rs +1 −1
  19. git-mailmap/src/snapshot.rs +1 −1
  20. git-odb/src/store_impls/dynamic/load_index.rs +1 −1
  21. git-odb/src/store_impls/dynamic/mod.rs +1 −1
  22. git-odb/src/store_impls/dynamic/types.rs +1 −1
  23. git-odb/tests/odb/store/dynamic.rs +1 −1
  24. git-pack/src/cache/delta/mod.rs +1 −1
  25. git-pack/src/data/file/decode_entry.rs +3 −3
  26. git-pack/src/data/input/entries_to_bytes.rs +2 −2
  27. git-pack/src/data/output/bytes.rs +1 −1
  28. git-pack/src/data/output/count/mod.rs +1 −1
  29. git-pack/src/data/output/count/objects/types.rs +1 −1
  30. git-pack/src/data/output/entry/iter_from_counts.rs +1 −1
  31. git-pack/src/multi_index/access.rs +1 −1
  32. git-pack/tests/pack/data/file.rs +2 −2
  33. git-pack/tests/pack/data/input.rs +1 −1
  34. git-packetline/tests/read/mod.rs +1 −1
  35. git-packetline/tests/read/sideband.rs +1 −1
  36. git-protocol/src/fetch/response/async_io.rs +1 −1
  37. git-protocol/src/fetch/response/blocking_io.rs +1 −1
  38. git-protocol/src/fetch/tests/arguments.rs +1 −1
  39. git-ref/src/peel.rs +1 −1
  40. git-ref/src/store/file/find.rs +1 −1
  41. git-ref/src/store/file/loose/reflog/create_or_update/tests.rs +1 −1
  42. git-ref/src/store/file/transaction/prepare.rs +2 −2
  43. git-ref/src/store/packed/transaction.rs +1 −1
  44. git-ref/tests/file/store/iter.rs +1 −1
  45. git-repository/src/config/snapshot.rs +1 −1
  46. git-repository/src/create.rs +1 −1
  47. git-repository/src/id.rs +2 −2
  48. git-repository/src/repository/worktree.rs +1 −1
  49. git-tempfile/README.md +1 −1
  50. git-tempfile/examples/try-deadlock-on-cleanup.rs +1 −1
  51. git-tempfile/src/handler.rs +1 −1
  52. git-transport/tests/client/git.rs +2 −2
  53. git-traverse/src/commit.rs +1 −1
  54. git-worktree/src/fs/cache/state.rs +2 −2
  55. gitoxide-core/Cargo.toml +1 −1
  56. gitoxide-core/src/net.rs +1 −1
  57. gitoxide-core/src/pack/create.rs +1 −1
  58. src/plumbing/options.rs +1 −1
Cargo.toml+1−1
@@ -118,7 +118,7 @@ codegen-units = 1 · 117 unmodified lines
118incremental = false118incremental = false
119build-override = { opt-level = 0 }119build-override = { opt-level = 0 }
120 120
121# It's not quite worth building depencies with more optimizations yet. Let's keep it here for later.121# It's not quite worth building dependencies with more optimizations yet. Let's keep it here for later.
122#[profile.dev.package."*"]122#[profile.dev.package."*"]
123#opt-level = 2123#opt-level = 2
124 124
DEVELOPMENT.md+1−1
@@ -150,7 +150,7 @@ by humans. · 149 unmodified lines
150* **Experiments**150* **Experiments**
151 * quick, potentially one-off programs to learn about an aspect of gitoxide potentially in comparison to other implementations like `libgit2`.151 * quick, potentially one-off programs to learn about an aspect of gitoxide potentially in comparison to other implementations like `libgit2`.
152 * No need for tests of any kind, but it must compile and be idiomatic Rust and `gitoxide`.152 * No need for tests of any kind, but it must compile and be idiomatic Rust and `gitoxide`.
153 * Manual commmand-line parsing is OK153 * Manual command-line parsing is OK
154 * no polish154 * no polish
155 * make it compile quickly, so no extras155 * make it compile quickly, so no extras
156* **Examples**156* **Examples**
cargo-smart-release/src/context.rs+1−1
@@ -52,7 +52,7 @@ impl Context { · 51 unmodified lines
52 .parent()52 .parent()
53 .expect("parent of a file is always present")53 .expect("parent of a file is always present")
54 .strip_prefix(&self.root)54 .strip_prefix(&self.root)
55 .expect("workspace members are releative to the root directory");55 .expect("workspace members are relative to the root directory");
56 56
57 if dir.as_os_str().is_empty() {57 if dir.as_os_str().is_empty() {
58 None58 None
cargo-smart-release/tests/changelog/parse.rs+1−1
@@ -111,7 +111,7 @@ fn known_and_unknown_sections_are_sorted() { · 110 unmodified lines
111 markdown: "- initial release\n\n".into()111 markdown: "- initial release\n\n".into()
112 },112 },
113 Segment::User {113 Segment::User {
114 markdown: "### Something inbetween\n\nintermezzo\n".into()114 markdown: "### Something in between\n\nintermezzo\n".into()
115 },115 },
116 ]116 ]
117 },117 },
cargo-smart-release/tests/fixtures/changelog/parse/unknown-known-unknown-known-unsorted.md+1−1
@@ -4,7 +4,7 @@ Hello, this is a changelog. · 3 unmodified lines
4 4
5- initial release5- initial release
6 6
7### Something inbetween7### Something in between
8 8
9intermezzo9intermezzo
10 10
deny.toml+1−1
@@ -32,7 +32,7 @@ ignore = [ ] · 31 unmodified lines
32[licenses]32[licenses]
33# The lint level for crates which do not have a detectable license33# The lint level for crates which do not have a detectable license
34unlicensed = "deny"34unlicensed = "deny"
35# List of explictly allowed licenses35# List of explicitly allowed licenses
36# See https://spdx.org/licenses/ for list of possible licenses36# See https://spdx.org/licenses/ for list of possible licenses
37# [possible values: any SPDX 3.11 short identifier (+ optional exception)].37# [possible values: any SPDX 3.11 short identifier (+ optional exception)].
38allow = [38allow = [
etc/discovery/odb.md+4−4
@@ -153,7 +153,7 @@ Solutions aren't always mutually exclusive despite the form of presentation sugg · 152 unmodified lines
153| | | 3. catch error, force a pack refresh, repeat | can work in conjunction with similar shortcomings of loose reference database | needs mutability, burden on the API user; | |153| | | 3. catch error, force a pack refresh, repeat | can work in conjunction with similar shortcomings of loose reference database | needs mutability, burden on the API user; | |
154| | | 4. writers force an update of the process-wide pool of packs after creating new packs and before updating references with the new objects | | high implementation complexity; assumes complete control of one process over git repository, excluding running git-maintenance; new readers aren't allowed for a while until the new pack is placed causing some moments of unresponsiveness/waiting | |154| | | 4. writers force an update of the process-wide pool of packs after creating new packs and before updating references with the new objects | | high implementation complexity; assumes complete control of one process over git repository, excluding running git-maintenance; new readers aren't allowed for a while until the new pack is placed causing some moments of unresponsiveness/waiting | |
155| **pack** | ~~5. race when creating/altering more than a pack at a time~~ | 1. ignore | | a chance for occasional object misses | all of them |155| **pack** | ~~5. race when creating/altering more than a pack at a time~~ | 1. ignore | | a chance for occasional object misses | all of them |
156| | | 2. retry more than one time | greatly reduced likelyhood of object misses | | |156| | | 2. retry more than one time | greatly reduced likelihood of object misses | | |
157| **pack** | **6.too many (small) packs (i.e. due to pack-receive) reduce lookup performance** | 1. explode pack into loose objects (and deal with them separately) | can run in parallel (but is typically bound by max IOP/s) | might take a while if many objects are contained in the pack due to file IOP/s; needs recompresssion and looses delta compression; risk of too many small objects | |157| **pack** | **6.too many (small) packs (i.e. due to pack-receive) reduce lookup performance** | 1. explode pack into loose objects (and deal with them separately) | can run in parallel (but is typically bound by max IOP/s) | might take a while if many objects are contained in the pack due to file IOP/s; needs recompresssion and looses delta compression; risk of too many small objects | |
158| | | 2. combine multiple packs into one | keep all benefits of packs; very fast if pack-to-pack copy is used; can run in parallel (but is typically bound by max IOP/s) | combining with big packs takes has to write a lot of data; can be costly if pack delta compression is used | |158| | | 2. combine multiple packs into one | keep all benefits of packs; very fast if pack-to-pack copy is used; can run in parallel (but is typically bound by max IOP/s) | combining with big packs takes has to write a lot of data; can be costly if pack delta compression is used | |
159| | | 3. Just-in-time maintenance after writes | tuned to run just at the right time to run just as much as needed | an implementation isn't trivial as there must only be one maintenance operation per repository at a time, so some queue should be made available to not skip maintenance just because one is running already. | |159| | | 3. Just-in-time maintenance after writes | tuned to run just at the right time to run just as much as needed | an implementation isn't trivial as there must only be one maintenance operation per repository at a time, so some queue should be made available to not skip maintenance just because one is running already. | |
@@ -238,7 +238,7 @@ for applications that don't need it, like CLIs. · 78 unmodified lines
238#### Loose References238#### Loose References
239 239
240Writing loose references isn't actually atomic, so readers may observe some references in an old and some in a new state. This isn't always a breaking issue like it is240Writing loose references isn't actually atomic, so readers may observe some references in an old and some in a new state. This isn't always a breaking issue like it is
241the case for packs, the progam can still operate and is likely to produce correct (enough) outcomes.241the case for packs, the program can still operate and is likely to produce correct (enough) outcomes.
242 242
243Mitigations are possible with careful programming on the API user's side or by using the `ref-table` database instead.243Mitigations are possible with careful programming on the API user's side or by using the `ref-table` database instead.
244 244
@@ -273,7 +273,7 @@ refresh to the user in case they fetched or pulled in the meantime, to refresh t · 28 unmodified lines
273**Drawbacks**273**Drawbacks**
274 274
275The program could benefit of using 1.2 instead of 1.1 which could cause exhaustion of file handles despite the user having no interest in evaluating all available objects,275The program could benefit of using 1.2 instead of 1.1 which could cause exhaustion of file handles despite the user having no interest in evaluating all available objects,
276but ideally that is possible without loosing performance during multi-threading.276but ideally that is possible without losing performance during multi-threading.
277 277
278### Professional git-hosting mono-repo server with git-maintenance tasks and just-in-time replication278### Professional git-hosting mono-repo server with git-maintenance tasks and just-in-time replication
279 279
@@ -381,7 +381,7 @@ The default favors speed and using all available cores, but savvy users can run · 101 unmodified lines
381 - not an issue as there isn't enough traffic here381 - not an issue as there isn't enough traffic here
382* **9.2** loose object database - too many loose objects reduce overall performance - just-in-time maintenance382* **9.2** loose object database - too many loose objects reduce overall performance - just-in-time maintenance
383* **10** - disk full - display early warnings in the front-end to every user to get it fixed383* **10** - disk full - display early warnings in the front-end to every user to get it fixed
384 - This solution is implemented on application side (and not in `gitoxide`), it's intersting enough to mention though for systems that operate themselves.384 - This solution is implemented on application side (and not in `gitoxide`), it's interesting enough to mention though for systems that operate themselves.
385 - One could also imagine that it tries to spend the nights aggressively compression repositories, some low-hanging fruits there.385 - One could also imagine that it tries to spend the nights aggressively compression repositories, some low-hanging fruits there.
386* **10** - write failure - fail connection386* **10** - write failure - fail connection
387 - write failures aren't specifically handled but result in typical Rust error behaviour probably alongside error reporting on the respective channels of the git-transport sideband.387 - write failures aren't specifically handled but result in typical Rust error behaviour probably alongside error reporting on the respective channels of the git-transport sideband.
git-bitmap/src/ewah.rs+1−1
@@ -21,7 +21,7 @@ pub fn decode(data: &[u8]) -> Result<(Vec, &[u8]), decode::Error> { · 20 unmodified lines
21 let (len, data) = decode::u32(data).ok_or(Error::Corrupt("eof reading chunk length"))?;21 let (len, data) = decode::u32(data).ok_or(Error::Corrupt("eof reading chunk length"))?;
22 let len = len as usize;22 let len = len as usize;
23 23
24 // NOTE: git does this by copying all bytes first, and then it will change the endianess in a separate loop.24 // NOTE: git does this by copying all bytes first, and then it will change the endianness in a separate loop.
25 // Maybe it's faster, but we can't do it without unsafe. Let's leave it to the optimizer and maybe25 // Maybe it's faster, but we can't do it without unsafe. Let's leave it to the optimizer and maybe
26 // one day somebody will find out that it's worth it to use unsafe here.26 // one day somebody will find out that it's worth it to use unsafe here.
27 let (mut bits, data) = decode::split_at_pos(data, len * std::mem::size_of::<u64>())27 let (mut bits, data) = decode::split_at_pos(data, len * std::mem::size_of::<u64>())
git-config/src/file/access/mutate.rs+2−2
@@ -234,12 +234,12 @@ impl<'event> File<'event> { · 233 unmodified lines
234 Ok(())234 Ok(())
235 }235 }
236 236
237 /// Append another File to the end of ourselves, without loosing any information.237 /// Append another File to the end of ourselves, without losing any information.
238 pub fn append(&mut self, other: Self) -> &mut Self {238 pub fn append(&mut self, other: Self) -> &mut Self {
239 self.append_or_insert(other, None)239 self.append_or_insert(other, None)
240 }240 }
241 241
242 /// Append another File to the end of ourselves, without loosing any information.242 /// Append another File to the end of ourselves, without losing any information.
243 pub(crate) fn append_or_insert(&mut self, mut other: Self, mut insert_after: Option<SectionId>) -> &mut Self {243 pub(crate) fn append_or_insert(&mut self, mut other: Self, mut insert_after: Option<SectionId>) -> &mut Self {
244 let nl = self.detect_newline_style_smallvec();244 let nl = self.detect_newline_style_smallvec();
245 fn extend_and_assure_newline<'a>(245 fn extend_and_assure_newline<'a>(
git-config/src/file/includes/mod.rs+1−1
@@ -24,7 +24,7 @@ impl File<'static> { · 23 unmodified lines
24 /// a deviation from how git does it, as it technically adds new value right after the include path itself,24 /// a deviation from how git does it, as it technically adds new value right after the include path itself,
25 /// technically 'splitting' the section. This can only make a difference if the `include` section also has values25 /// technically 'splitting' the section. This can only make a difference if the `include` section also has values
26 /// which later overwrite portions of the included file, which seems unusual as these would be related to `includes`.26 /// which later overwrite portions of the included file, which seems unusual as these would be related to `includes`.
27 /// We can fix this by 'splitting' the inlcude section if needed so the included sections are put into the right place.27 /// We can fix this by 'splitting' the include section if needed so the included sections are put into the right place.
28 pub fn resolve_includes(&mut self, options: init::Options<'_>) -> Result<(), Error> {28 pub fn resolve_includes(&mut self, options: init::Options<'_>) -> Result<(), Error> {
29 if options.includes.max_depth == 0 {29 if options.includes.max_depth == 0 {
30 return Ok(());30 return Ok(());
git-config/src/file/mod.rs+2−2
@@ -61,7 +61,7 @@ pub struct Section<'a> { · 60 unmodified lines
61 meta: OwnShared<Metadata>,61 meta: OwnShared<Metadata>,
62}62}
63 63
64/// A function to filter metadata, returning `true` if the corresponding but ommitted value can be used.64/// A function to filter metadata, returning `true` if the corresponding but omitted value can be used.
65pub type MetadataFilter = dyn FnMut(&'_ Metadata) -> bool;65pub type MetadataFilter = dyn FnMut(&'_ Metadata) -> bool;
66 66
67/// A strongly typed index into some range.67/// A strongly typed index into some range.
@@ -76,7 +76,7 @@ impl Add<Size> for Index { · 8 unmodified lines
76 }76 }
77}77}
78 78
79/// A stronlgy typed a size.79/// A strongly typed a size.
80#[derive(PartialEq, Eq, Hash, PartialOrd, Ord, Debug, Clone, Copy)]80#[derive(PartialEq, Eq, Hash, PartialOrd, Ord, Debug, Clone, Copy)]
81pub(crate) struct Size(pub(crate) usize);81pub(crate) struct Size(pub(crate) usize);
82 82
git-config/src/parse/events.rs+1−1
@@ -7,7 +7,7 @@ use crate::{ · 6 unmodified lines
7 parse::{section, Event, Section},7 parse::{section, Event, Section},
8};8};
9 9
10/// A type store without allocation all events that are typicaly preceeding the first section.10/// A type store without allocation all events that are typically preceding the first section.
11pub type FrontMatterEvents<'a> = SmallVec<[Event<'a>; 8]>;11pub type FrontMatterEvents<'a> = SmallVec<[Event<'a>; 8]>;
12 12
13/// A zero-copy `git-config` file parser.13/// A zero-copy `git-config` file parser.
git-diff/src/tree/visit.rs+1−1
@@ -37,7 +37,7 @@ pub enum Change { · 36 unmodified lines
37pub enum Action {37pub enum Action {
38 /// Continue the traversal of changes.38 /// Continue the traversal of changes.
39 Continue,39 Continue,
40 /// Stop the traversal of changes, making this te last call to [visit(…)][Visit::visit()].40 /// Stop the traversal of changes, making this the last call to [visit(…)][Visit::visit()].
41 Cancel,41 Cancel,
42}42}
43 43
git-diff/tests/fixtures/generated-archives/make_diff_repo.tar.xz+2−2
@@ -1,3 +1,3 @@
1version https://git-lfs.github.com/spec/v11version https://git-lfs.github.com/spec/v1
2oid sha256:f9ebb33f4370bf3b2a2c39957b586b3ee003b8f8539aa98fb89d4009f8f99cef2oid sha256:a121ee880e909e430504c730c3d3d14079f380c19811e65512ec836597c192b9
3size 171443size 15996
git-features/src/parallel/in_parallel.rs+2−2
@@ -16,7 +16,7 @@ pub fn join<O1: Send, O2: Send>(left: impl FnOnce() -> O1 + Send, right: impl Fn · 15 unmodified lines
16/// That way it's possible to handle threads without needing the 'static lifetime for data they interact with.16/// That way it's possible to handle threads without needing the 'static lifetime for data they interact with.
17///17///
18/// Note that the threads should not rely on actual parallelism as threading might be turned off entirely, hence should not18/// Note that the threads should not rely on actual parallelism as threading might be turned off entirely, hence should not
19/// connect each other with channels as deadlock would occour in single-threaded mode.19/// connect each other with channels as deadlock would occur in single-threaded mode.
20pub fn threads<'env, F, R>(f: F) -> std::thread::Result<R>20pub fn threads<'env, F, R>(f: F) -> std::thread::Result<R>
21where21where
22 F: FnOnce(&crossbeam_utils::thread::Scope<'env>) -> R,22 F: FnOnce(&crossbeam_utils::thread::Scope<'env>) -> R,
@@ -85,7 +85,7 @@ where · 62 unmodified lines
85}85}
86 86
87/// An experiment to have fine-grained per-item parallelization with built-in aggregation via thread state.87/// An experiment to have fine-grained per-item parallelization with built-in aggregation via thread state.
88/// This is only good for operations where near-random access isn't detremental, so it's not usually great88/// This is only good for operations where near-random access isn't detrimental, so it's not usually great
89/// for file-io as it won't make use of sorted inputs well.89/// for file-io as it won't make use of sorted inputs well.
90/// Note that `periodic` is not guaranteed to be called in case other threads come up first and finish too fast.90/// Note that `periodic` is not guaranteed to be called in case other threads come up first and finish too fast.
91// TODO: better docs91// TODO: better docs
git-features/src/parallel/serial.rs+1−1
@@ -57,7 +57,7 @@ mod not_parallel { · 56 unmodified lines
57 }57 }
58 58
59 /// An experiment to have fine-grained per-item parallelization with built-in aggregation via thread state.59 /// An experiment to have fine-grained per-item parallelization with built-in aggregation via thread state.
60 /// This is only good for operations where near-random access isn't detremental, so it's not usually great60 /// This is only good for operations where near-random access isn't detrimental, so it's not usually great
61 /// for file-io as it won't make use of sorted inputs well.61 /// for file-io as it won't make use of sorted inputs well.
62 // TODO: better docs62 // TODO: better docs
63 pub fn in_parallel_with_slice<I, S, E>(63 pub fn in_parallel_with_slice<I, S, E>(
git-mailmap/src/entry.rs+1−1
@@ -2,7 +2,7 @@ use bstr::BStr; · 1 unmodified line
2 2
3use crate::Entry;3use crate::Entry;
4 4
5/// Acccess5/// Access
6impl<'a> Entry<'a> {6impl<'a> Entry<'a> {
7 /// The name to map to.7 /// The name to map to.
8 pub fn new_name(&self) -> Option<&'a BStr> {8 pub fn new_name(&self) -> Option<&'a BStr> {
git-mailmap/src/lib.rs+1−1
@@ -10,7 +10,7 @@ pub mod parse; · 9 unmodified lines
10 10
11/// Parse the given `buf` of bytes line by line into mapping [Entries][Entry].11/// Parse the given `buf` of bytes line by line into mapping [Entries][Entry].
12///12///
13/// Errors may occour per line, but it's up to the caller to stop iteration when13/// Errors may occur per line, but it's up to the caller to stop iteration when
14/// one is encountered.14/// one is encountered.
15pub fn parse(buf: &[u8]) -> parse::Lines<'_> {15pub fn parse(buf: &[u8]) -> parse::Lines<'_> {
16 parse::Lines::new(buf)16 parse::Lines::new(buf)
git-mailmap/src/snapshot.rs+1−1
@@ -183,7 +183,7 @@ impl<'a> From<crate::Entry<'a>> for EmailEntry { · 182 unmodified lines
183}183}
184 184
185impl Snapshot {185impl Snapshot {
186 /// Create a new snapshot from the given bytes buffer, ignoring all parse errors that may occour on a line-by-line basis.186 /// Create a new snapshot from the given bytes buffer, ignoring all parse errors that may occur on a line-by-line basis.
187 ///187 ///
188 /// This is similar to what git does.188 /// This is similar to what git does.
189 pub fn from_bytes(buf: &[u8]) -> Self {189 pub fn from_bytes(buf: &[u8]) -> Self {
git-odb/src/store_impls/dynamic/load_index.rs+1−1
@@ -531,7 +531,7 @@ impl super::Store { · 530 unmodified lines
531 let mut files = slot.files.load_full();531 let mut files = slot.files.load_full();
532 let files_mut = Arc::make_mut(&mut files);532 let files_mut = Arc::make_mut(&mut files);
533 // set the generation before we actually change the value, otherwise readers of old generations could observe the new one.533 // set the generation before we actually change the value, otherwise readers of old generations could observe the new one.
534 // We rather want them to turn around here and update their index, which, by that time, migth actually already be available.534 // We rather want them to turn around here and update their index, which, by that time, might actually already be available.
535 // If not, they would fail unable to load a pack or index they need, but that's preferred over returning wrong objects.535 // If not, they would fail unable to load a pack or index they need, but that's preferred over returning wrong objects.
536 // Safety: can't race as we hold the lock, have to set the generation beforehand to help avoid others to observe the value.536 // Safety: can't race as we hold the lock, have to set the generation beforehand to help avoid others to observe the value.
537 slot.generation.store(generation, Ordering::SeqCst);537 slot.generation.store(generation, Ordering::SeqCst);
git-odb/src/store_impls/dynamic/mod.rs+1−1
@@ -134,7 +134,7 @@ pub mod structure { · 133 unmodified lines
134 ///134 ///
135 /// Note that this call is expensive as it gathers additional information about loose object databases.135 /// Note that this call is expensive as it gathers additional information about loose object databases.
136 /// Note that it may change as we collect information due to the highly volatile nature of the136 /// Note that it may change as we collect information due to the highly volatile nature of the
137 /// implementation. The likelyhood of actual changes is low though as these still depend on something137 /// implementation. The likelihood of actual changes is low though as these still depend on something
138 /// changing on disk and somebody reading at the same time.138 /// changing on disk and somebody reading at the same time.
139 pub fn structure(&self) -> Result<Vec<Record>, load_index::Error> {139 pub fn structure(&self) -> Result<Vec<Record>, load_index::Error> {
140 let index = self.index.load();140 let index = self.index.load();
git-odb/src/store_impls/dynamic/types.rs+1−1
@@ -259,7 +259,7 @@ impl IndexAndPacks { · 258 unmodified lines
259 }259 }
260 }260 }
261 261
262 /// If we are garbaged, put ourselve into the loaded state. Otherwise put ourselves back to unloaded.262 /// If we are garbaged, put ourselves into the loaded state. Otherwise put ourselves back to unloaded.
263 pub(crate) fn put_back(&mut self) {263 pub(crate) fn put_back(&mut self) {
264 match self {264 match self {
265 IndexAndPacks::Index(bundle) => {265 IndexAndPacks::Index(bundle) => {
git-odb/tests/odb/store/dynamic.rs+1−1
@@ -325,7 +325,7 @@ fn contains() { · 324 unmodified lines
325 unreachable_indices: 0,325 unreachable_indices: 0,
326 unreachable_packs: 0326 unreachable_packs: 0
327 },327 },
328 "when asking for an object in the smallest pack, all inbetween packs are also loaded."328 "when asking for an object in the smallest pack, all in between packs are also loaded."
329 );329 );
330 330
331 assert!(!new_handle.contains(hex_to_id("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")));331 assert!(!new_handle.contains(hex_to_id("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")));
git-pack/src/cache/delta/mod.rs+1−1
@@ -44,7 +44,7 @@ enum NodeKind { · 43 unmodified lines
44pub struct Tree<T> {44pub struct Tree<T> {
45 /// The root nodes, i.e. base objects45 /// The root nodes, i.e. base objects
46 root_items: Vec<Item<T>>,46 root_items: Vec<Item<T>>,
47 /// The child nodes, i.e. those that rely a base object, like ref and ofs delta objets47 /// The child nodes, i.e. those that rely a base object, like ref and ofs delta objects
48 child_items: Vec<Item<T>>,48 child_items: Vec<Item<T>>,
49 /// The last encountered node was either a root or a child.49 /// The last encountered node was either a root or a child.
50 last_seen: Option<NodeKind>,50 last_seen: Option<NodeKind>,
git-pack/src/data/file/decode_entry.rs+3−3
@@ -135,7 +135,7 @@ impl File { · 134 unmodified lines
135 /// a base object, instead of an in-pack offset.135 /// a base object, instead of an in-pack offset.
136 ///136 ///
137 /// `delta_cache` is a mechanism to avoid looking up base objects multiple times when decompressing multiple objects in a row.137 /// `delta_cache` is a mechanism to avoid looking up base objects multiple times when decompressing multiple objects in a row.
138 /// Use a [Noop-Cache][cache::Never] to disable caching alltogether at the cost of repeating work.138 /// Use a [Noop-Cache][cache::Never] to disable caching all together at the cost of repeating work.
139 pub fn decode_entry(139 pub fn decode_entry(
140 &self,140 &self,
141 entry: crate::data::Entry,141 entry: crate::data::Entry,
@@ -165,7 +165,7 @@ impl File { · 23 unmodified lines
165 }165 }
166 }166 }
167 167
168 /// resolve: technically, this shoudln't ever be required as stored local packs don't refer to objects by id168 /// resolve: technically, this shouldn't ever be required as stored local packs don't refer to objects by id
169 /// that are outside of the pack. Unless, of course, the ref refers to an object within this pack, which means169 /// that are outside of the pack. Unless, of course, the ref refers to an object within this pack, which means
170 /// it's very, very large as 20bytes are smaller than the corresponding MSB encoded number170 /// it's very, very large as 20bytes are smaller than the corresponding MSB encoded number
171 fn resolve_deltas(171 fn resolve_deltas(
@@ -298,7 +298,7 @@ impl File { · 126 unmodified lines
298 let end = first_buffer_size + second_buffer_size;298 let end = first_buffer_size + second_buffer_size;
299 if delta_range.start < end {299 if delta_range.start < end {
300 // …this means that the delta size is even larger than two uncompressed worst-case300 // …this means that the delta size is even larger than two uncompressed worst-case
301 // intermediate results combined. It would already be undesireable to have it bigger301 // intermediate results combined. It would already be undesirable to have it bigger
302 // then the target size (as you could just store the object in whole).302 // then the target size (as you could just store the object in whole).
303 // However, this just means that it reuses existing deltas smartly, which as we rightfully303 // However, this just means that it reuses existing deltas smartly, which as we rightfully
304 // remember stand for an object each. However, this means a lot of data is read to restore304 // remember stand for an object each. However, this means a lot of data is read to restore
git-pack/src/data/input/entries_to_bytes.rs+2−2
@@ -21,7 +21,7 @@ pub struct EntriesToBytesIter<I: Iterator, W> { · 20 unmodified lines
21 data_version: crate::data::Version,21 data_version: crate::data::Version,
22 /// The amount of entries seen so far22 /// The amount of entries seen so far
23 num_entries: u32,23 num_entries: u32,
24 /// If we are done, no additional writes will occour24 /// If we are done, no additional writes will occur
25 is_done: bool,25 is_done: bool,
26 /// The kind of hash to use for the digest26 /// The kind of hash to use for the digest
27 object_hash: git_hash::Kind,27 object_hash: git_hash::Kind,
@@ -33,7 +33,7 @@ where · 5 unmodified lines
33 W: std::io::Read + std::io::Write + std::io::Seek,33 W: std::io::Read + std::io::Write + std::io::Seek,
34{34{
35 /// Create a new instance reading [entries][input::Entry] from an `input` iterator and write pack data bytes to35 /// Create a new instance reading [entries][input::Entry] from an `input` iterator and write pack data bytes to
36 /// `output` writer, resembling a pack of `version`. The amonut of entries will be dynaimcally determined and36 /// `output` writer, resembling a pack of `version`. The amount of entries will be dynaimcally determined and
37 /// the pack is completed once the last entry was written.37 /// the pack is completed once the last entry was written.
38 /// `object_hash` is the kind of hash to use for the pack checksum and maybe other places, depending on the version.38 /// `object_hash` is the kind of hash to use for the pack checksum and maybe other places, depending on the version.
39 ///39 ///
git-pack/src/data/output/bytes.rs+1−1
@@ -37,7 +37,7 @@ pub struct FromEntriesIter<I, W> { · 36 unmodified lines
37 /// It stores the pack offsets at which objects begin.37 /// It stores the pack offsets at which objects begin.
38 /// Additionally we store if an object was invalid, and if so we will not write it nor will we allow delta objects to it.38 /// Additionally we store if an object was invalid, and if so we will not write it nor will we allow delta objects to it.
39 pack_offsets_and_validity: Vec<(u64, bool)>,39 pack_offsets_and_validity: Vec<(u64, bool)>,
40 /// If we are done, no additional writes will occour40 /// If we are done, no additional writes will occur
41 is_done: bool,41 is_done: bool,
42}42}
43 43
git-pack/src/data/output/count/mod.rs+1−1
@@ -8,7 +8,7 @@ use crate::data::output::Count; · 7 unmodified lines
8pub enum PackLocation {8pub enum PackLocation {
9 /// We did not lookup this object9 /// We did not lookup this object
10 NotLookedUp,10 NotLookedUp,
11 /// The object was looked up and there may be a location in a pack, along with enty information11 /// The object was looked up and there may be a location in a pack, along with entry information
12 LookedUp(Option<crate::data::entry::Location>),12 LookedUp(Option<crate::data::entry::Location>),
13}13}
14 14
git-pack/src/data/output/count/objects/types.rs+1−1
@@ -58,7 +58,7 @@ impl Default for ObjectExpansion { · 57 unmodified lines
58 }58 }
59}59}
60 60
61/// Configuration options for the pack generation functions provied in [this module][crate::data::output].61/// Configuration options for the pack generation functions provided in [this module][crate::data::output].
62#[derive(PartialEq, Eq, Debug, Hash, Ord, PartialOrd, Clone, Copy)]62#[derive(PartialEq, Eq, Debug, Hash, Ord, PartialOrd, Clone, Copy)]
63#[cfg_attr(feature = "serde1", derive(serde::Serialize, serde::Deserialize))]63#[cfg_attr(feature = "serde1", derive(serde::Serialize, serde::Deserialize))]
64pub struct Options {64pub struct Options {
git-pack/src/data/output/entry/iter_from_counts.rs+1−1
@@ -351,7 +351,7 @@ mod types { · 350 unmodified lines
351 PackCopyAndBaseObjects,351 PackCopyAndBaseObjects,
352 }352 }
353 353
354 /// Configuration options for the pack generation functions provied in [this module][crate::data::output].354 /// Configuration options for the pack generation functions provided in [this module][crate::data::output].
355 #[derive(PartialEq, Eq, Debug, Hash, Ord, PartialOrd, Clone, Copy)]355 #[derive(PartialEq, Eq, Debug, Hash, Ord, PartialOrd, Clone, Copy)]
356 #[cfg_attr(feature = "serde1", derive(serde::Serialize, serde::Deserialize))]356 #[cfg_attr(feature = "serde1", derive(serde::Serialize, serde::Deserialize))]
357 pub struct Options {357 pub struct Options {
git-pack/src/multi_index/access.rs+1−1
@@ -24,7 +24,7 @@ pub struct Entry { · 23 unmodified lines
24 24
25/// Access methods25/// Access methods
26impl File {26impl File {
27 /// Returns the verion of the multi-index file.27 /// Returns the version of the multi-index file.
28 pub fn version(&self) -> Version {28 pub fn version(&self) -> Version {
29 self.version29 self.version
30 }30 }
git-pack/tests/pack/data/file.rs+2−2
@@ -67,7 +67,7 @@ mod decode_entry { · 66 unmodified lines
67 #[test]67 #[test]
68 fn blob_ofs_delta_two_links() {68 fn blob_ofs_delta_two_links() {
69 let buf = decode_entry_at_offset(3033);69 let buf = decode_entry_at_offset(3033);
70 assert_eq!(buf.len(), 173, "buffer length is the acutal object size");70 assert_eq!(buf.len(), 173, "buffer length is the actual object size");
71 assert_eq!(71 assert_eq!(
72 buf.capacity(),72 buf.capacity(),
73 2381,73 2381,
@@ -82,7 +82,7 @@ mod decode_entry { · 8 unmodified lines
82 #[test]82 #[test]
83 fn blob_ofs_delta_single_link() {83 fn blob_ofs_delta_single_link() {
84 let buf = decode_entry_at_offset(3569);84 let buf = decode_entry_at_offset(3569);
85 assert_eq!(buf.len(), 1163, "buffer length is the acutal object size");85 assert_eq!(buf.len(), 1163, "buffer length is the actual object size");
86 assert_eq!(86 assert_eq!(
87 buf.capacity(),87 buf.capacity(),
88 2398,88 2398,
git-pack/tests/pack/data/input.rs+1−1
@@ -182,7 +182,7 @@ mod lookup_ref_delta_objects { · 181 unmodified lines
182 }),182 }),
183 Ok(entry(base(), D_B)),183 Ok(entry(base(), D_B)),
184 ];184 ];
185 let actual = LookupRefDeltaObjectsIter::new(input.into_iter(), |_, _| unreachable!("wont be called"))185 let actual = LookupRefDeltaObjectsIter::new(input.into_iter(), |_, _| unreachable!("won't be called"))
186 .collect::<Vec<_>>();186 .collect::<Vec<_>>();
187 for (actual, expected) in actual.into_iter().zip(expected.into_iter()) {187 for (actual, expected) in actual.into_iter().zip(expected.into_iter()) {
188 assert_eq!(format!("{:?}", actual), format!("{:?}", expected));188 assert_eq!(format!("{:?}", actual), format!("{:?}", expected));
git-packetline/tests/read/mod.rs+1−1
@@ -187,7 +187,7 @@ pub mod streaming_peek_iter { · 186 unmodified lines
187 "it should read the second part of the identical file from the previously advanced reader"187 "it should read the second part of the identical file from the previously advanced reader"
188 );188 );
189 189
190 // this reset is will cause actual io::Errors to occour190 // this reset is will cause actual io::Errors to occur
191 rd.reset();191 rd.reset();
192 let res = rd.read_line().await;192 let res = rd.read_line().await;
193 assert_eq!(193 assert_eq!(
git-packetline/tests/read/sideband.rs+1−1
@@ -183,7 +183,7 @@ async fn peek_past_a_delimiter_is_no_error() -> crate::Result { · 182 unmodified lines
183 let res = reader.peek_data_line().await;183 let res = reader.peek_data_line().await;
184 assert!(184 assert!(
185 res.is_none(),185 res.is_none(),
186 "peeking past a flush packet is a 'natural' event that shold not cause an error"186 "peeking past a flush packet is a 'natural' event that should not cause an error"
187 );187 );
188 Ok(())188 Ok(())
189}189}
git-protocol/src/fetch/response/async_io.rs+1−1
@@ -46,7 +46,7 @@ impl Response { · 45 unmodified lines
46 line.clear();46 line.clear();
47 let peeked_line = match reader.peek_data_line().await {47 let peeked_line = match reader.peek_data_line().await {
48 Some(Ok(Ok(line))) => String::from_utf8_lossy(line),48 Some(Ok(Ok(line))) => String::from_utf8_lossy(line),
49 // This special case (hang/block forver) deals with a single NAK being a legitimate EOF sometimes49 // This special case (hang/block forever) deals with a single NAK being a legitimate EOF sometimes
50 // Note that this might block forever in stateful connections as there it's not really clear50 // Note that this might block forever in stateful connections as there it's not really clear
51 // if something will be following or not by just looking at the response. Instead you have to know51 // if something will be following or not by just looking at the response. Instead you have to know
52 // the arguments sent to the server and count response lines based on intricate knowledge on how the52 // the arguments sent to the server and count response lines based on intricate knowledge on how the
git-protocol/src/fetch/response/blocking_io.rs+1−1
@@ -45,7 +45,7 @@ impl Response { · 44 unmodified lines
45 line.clear();45 line.clear();
46 let peeked_line = match reader.peek_data_line() {46 let peeked_line = match reader.peek_data_line() {
47 Some(Ok(Ok(line))) => String::from_utf8_lossy(line),47 Some(Ok(Ok(line))) => String::from_utf8_lossy(line),
48 // This special case (hang/block forver) deals with a single NAK being a legitimate EOF sometimes48 // This special case (hang/block forever) deals with a single NAK being a legitimate EOF sometimes
49 // Note that this might block forever in stateful connections as there it's not really clear49 // Note that this might block forever in stateful connections as there it's not really clear
50 // if something will be following or not by just looking at the response. Instead you have to know50 // if something will be following or not by just looking at the response. Instead you have to know
51 // the arguments sent to the server and count response lines based on intricate knowledge on how the51 // the arguments sent to the server and count response lines based on intricate knowledge on how the
git-protocol/src/fetch/tests/arguments.rs+1−1
@@ -239,7 +239,7 @@ mod v2 { · 238 unmodified lines
2390009done2390009done
2400000"2400000"
241 .as_bstr(),241 .as_bstr(),
242 "we filter features/capabilities without value as these apparently sholdn't be listed (remote dies otherwise)"242 "we filter features/capabilities without value as these apparently shouldn't be listed (remote dies otherwise)"
243 );243 );
244 }244 }
245 245
git-ref/src/peel.rs+1−1
@@ -32,7 +32,7 @@ pub mod to_id { · 31 unmodified lines
32 display("Refusing to follow more than {} levels of indirection", max_depth)32 display("Refusing to follow more than {} levels of indirection", max_depth)
33 }33 }
34 Find(err: Box<dyn std::error::Error + Send + Sync + 'static>) {34 Find(err: Box<dyn std::error::Error + Send + Sync + 'static>) {
35 display("An error occurred when trying to resolve an object a refererence points to")35 display("An error occurred when trying to resolve an object a reference points to")
36 from()36 from()
37 source(&**err)37 source(&**err)
38 }38 }
git-ref/src/store/file/find.rs+1−1
@@ -315,7 +315,7 @@ pub mod existing { · 314 unmodified lines
315 #[allow(missing_docs)]315 #[allow(missing_docs)]
316 pub enum Error {316 pub enum Error {
317 Find(err: find::Error) {317 Find(err: find::Error) {
318 display("An error occured while trying to find a reference")318 display("An error occurred while trying to find a reference")
319 from()319 from()
320 source(err)320 source(err)
321 }321 }
git-ref/src/store/file/loose/reflog/create_or_update/tests.rs+1−1
@@ -60,7 +60,7 @@ fn missing_reflog_creates_it_even_if_similarly_named_empty_dir_exists_and_append · 59 unmodified lines
60 let new = hex_to_id("28ce6a8b26aa170e1de65536fe8abe1832bd3242");60 let new = hex_to_id("28ce6a8b26aa170e1de65536fe8abe1832bd3242");
61 let committer = Signature {61 let committer = Signature {
62 name: "committer".into(),62 name: "committer".into(),
63 email: "commiter@example.com".into(),63 email: "committer@example.com".into(),
64 time: Time {64 time: Time {
65 seconds_since_unix_epoch: 1234,65 seconds_since_unix_epoch: 1234,
66 offset_in_seconds: 1800,66 offset_in_seconds: 1800,
git-ref/src/store/file/transaction/prepare.rs+2−2
@@ -59,7 +59,7 @@ impl<'s> Transaction<'s> { · 58 unmodified lines
59 )59 )
60 .map_err(|err| Error::LockAcquire {60 .map_err(|err| Error::LockAcquire {
61 err,61 err,
62 full_name: "borrowchk wont allow change.name()".into(),62 full_name: "borrowchk won't allow change.name()".into(),
63 })?;63 })?;
64 let existing_ref = existing_ref?;64 let existing_ref = existing_ref?;
65 match (&expected, &existing_ref) {65 match (&expected, &existing_ref) {
@@ -105,7 +105,7 @@ impl<'s> Transaction<'s> { · 39 unmodified lines
105 )105 )
106 .map_err(|err| Error::LockAcquire {106 .map_err(|err| Error::LockAcquire {
107 err,107 err,
108 full_name: "borrowchk wont allow change.name() and this will be corrected by caller".into(),108 full_name: "borrowchk won't allow change.name() and this will be corrected by caller".into(),
109 })?;109 })?;
110 110
111 let existing_ref = existing_ref?;111 let existing_ref = existing_ref?;
git-ref/src/store/packed/transaction.rs+1−1
@@ -260,7 +260,7 @@ pub mod commit { · 259 unmodified lines
260 #[allow(missing_docs)]260 #[allow(missing_docs)]
261 pub enum Error {261 pub enum Error {
262 Commit(err: git_lock::commit::Error<git_lock::File>) {262 Commit(err: git_lock::commit::Error<git_lock::File>) {
263 display("Changes to the resource could not be comitted")263 display("Changes to the resource could not be committed")
264 from()264 from()
265 source(err)265 source(err)
266 }266 }
git-ref/tests/file/store/iter.rs+1−1
@@ -265,7 +265,7 @@ fn loose_iter_with_broken_refs() -> crate::Result { · 264 unmodified lines
265 #[cfg(windows)]265 #[cfg(windows)]
266 let msg = "The reference at 'refs\\broken' could not be instantiated";266 let msg = "The reference at 'refs\\broken' could not be instantiated";
267 assert_eq!(267 assert_eq!(
268 actual[first_error].as_ref().expect_err("unparseable ref").to_string(),268 actual[first_error].as_ref().expect_err("unparsable ref").to_string(),
269 msg269 msg
270 );270 );
271 let ref_paths: Vec<_> = actual271 let ref_paths: Vec<_> = actual
git-repository/src/config/snapshot.rs+1−1
@@ -61,7 +61,7 @@ impl<'repo> Snapshot<'repo> { · 60 unmodified lines
61 61
62 /// Return the trusted and fully interpolated path at `key`, or `None` if there is no such value62 /// Return the trusted and fully interpolated path at `key`, or `None` if there is no such value
63 /// or if no value was found in a trusted file.63 /// or if no value was found in a trusted file.
64 /// An error occours if the path could not be interpolated to its final value.64 /// An error occurs if the path could not be interpolated to its final value.
65 pub fn trusted_path(65 pub fn trusted_path(
66 &self,66 &self,
67 key: &str,67 key: &str,
git-repository/src/create.rs+1−1
@@ -102,7 +102,7 @@ pub struct Options { · 101 unmodified lines
102 /// If true, the repository will be a bare repository without a worktree.102 /// If true, the repository will be a bare repository without a worktree.
103 pub bare: bool,103 pub bare: bool,
104 104
105 /// If set, use these filesytem capabilities to populate the respective git-config fields.105 /// If set, use these filesystem capabilities to populate the respective git-config fields.
106 /// If `None`, the directory will be probed.106 /// If `None`, the directory will be probed.
107 pub fs_capabilities: Option<git_worktree::fs::Capabilities>,107 pub fs_capabilities: Option<git_worktree::fs::Capabilities>,
108}108}
git-repository/src/id.rs+2−2
@@ -147,7 +147,7 @@ pub mod ancestors { · 146 unmodified lines
147 error_on_missing_commit: bool,147 error_on_missing_commit: bool,
148 // TODO: tests148 // TODO: tests
149 /// After iteration this flag is true if the iteration was stopped prematurely due to missing parent commits.149 /// After iteration this flag is true if the iteration was stopped prematurely due to missing parent commits.
150 /// Note that this flag won't be `Some` if any iteration error occours, which is the case if150 /// Note that this flag won't be `Some` if any iteration error occurs, which is the case if
151 /// [`error_on_missing_commit()`][Iter::error_on_missing_commit()] was called.151 /// [`error_on_missing_commit()`][Iter::error_on_missing_commit()] was called.
152 ///152 ///
153 /// This happens if a repository is a shallow clone.153 /// This happens if a repository is a shallow clone.
@@ -157,7 +157,7 @@ pub mod ancestors { · 3 unmodified lines
157 157
158 impl<'repo> Iter<'repo> {158 impl<'repo> Iter<'repo> {
159 // TODO: tests159 // TODO: tests
160 /// Once invoked, the iteration will return an error if a commit cannot be found in the object database. This typicall happens160 /// Once invoked, the iteration will return an error if a commit cannot be found in the object database. This typically happens
161 /// when operating on a shallow clone and thus is non-critical by default.161 /// when operating on a shallow clone and thus is non-critical by default.
162 ///162 ///
163 /// Check the [`is_shallow`][Iter::is_shallow] field once the iteration ended otherwise to learn if a shallow commit graph163 /// Check the [`is_shallow`][Iter::is_shallow] field once the iteration ended otherwise to learn if a shallow commit graph
git-repository/src/repository/worktree.rs+1−1
@@ -41,7 +41,7 @@ impl crate::Repository { · 40 unmodified lines
41impl crate::Repository {41impl crate::Repository {
42 /// Return the repository owning the main worktree.42 /// Return the repository owning the main worktree.
43 ///43 ///
44 /// Note that it might be the one that is currently open if this repository dosn't point to a linked worktree.44 /// Note that it might be the one that is currently open if this repository doesn't point to a linked worktree.
45 /// Also note that the main repo might be bare.45 /// Also note that the main repo might be bare.
46 pub fn main_repo(&self) -> Result<crate::Repository, crate::open::Error> {46 pub fn main_repo(&self) -> Result<crate::Repository, crate::open::Error> {
47 crate::ThreadSafeRepository::open_opts(self.common_dir(), self.options.clone()).map(Into::into)47 crate::ThreadSafeRepository::open_opts(self.common_dir(), self.options.clone()).map(Into::into)
git-tempfile/README.md+1−1
@@ -4,7 +4,7 @@ in a signal-safe way, making the change atomic. · 3 unmodified lines
4Tempfiles can also be used as locks as only one tempfile can exist at a given path at a time.4Tempfiles can also be used as locks as only one tempfile can exist at a given path at a time.
5 5
6* [x] registered temporary files which are deleted automatically as the process terminates or on drop6* [x] registered temporary files which are deleted automatically as the process terminates or on drop
7 * [x] write to temorary file and persist it under new name7 * [x] write to temporary file and persist it under new name
8 * [x] close temporary files to convert them into a marker while saving system resources8 * [x] close temporary files to convert them into a marker while saving system resources
9 * [x] mark paths with a closed temporary file9 * [x] mark paths with a closed temporary file
10* [x] persist temporary files to prevent them from perishing.10* [x] persist temporary files to prevent them from perishing.
git-tempfile/examples/try-deadlock-on-cleanup.rs+1−1
@@ -52,7 +52,7 @@ fn main() -> Result<(), Box<dyn std::error::Error>> { · 51 unmodified lines
52 let signal_raised = Arc::clone(&signal_raised);52 let signal_raised = Arc::clone(&signal_raised);
53 move || {53 move || {
54 eprintln!(54 eprintln!(
55 "If a deadlock occours tempfiles will be left in '{}'",55 "If a deadlock occurs tempfiles will be left in '{}'",
56 tmp.path().display()56 tmp.path().display()
57 );57 );
58 for ttl in (1..=secs_to_run).rev() {58 for ttl in (1..=secs_to_run).rev() {
git-tempfile/src/handler.rs+1−1
@@ -7,7 +7,7 @@ use crate::{SignalHandlerMode, NEXT_MAP_INDEX, REGISTER, SIGNAL_HANDLER_MODE}; · 6 unmodified lines
7///7///
8/// # Safety8/// # Safety
9/// Note that Mutexes of any kind are not allowed, and so aren't allocation or deallocation of memory.9/// Note that Mutexes of any kind are not allowed, and so aren't allocation or deallocation of memory.
10/// We are usign lock-free datastructures and sprinkle in `std::mem::forget` to avoid deallocating.10/// We are using lock-free datastructures and sprinkle in `std::mem::forget` to avoid deallocating.
11pub fn cleanup_tempfiles() {11pub fn cleanup_tempfiles() {
12 let current_pid = std::process::id();12 let current_pid = std::process::id();
13 let one_past_last_index = NEXT_MAP_INDEX.load(Ordering::SeqCst);13 let one_past_last_index = NEXT_MAP_INDEX.load(Ordering::SeqCst);
git-transport/tests/client/git.rs+2−2
@@ -199,9 +199,9 @@ async fn handshake_v2_and_request() -> crate::Result { · 198 unmodified lines
199 // This monstrosity simulates how one can process a pack received in async-io by transforming it into199 // This monstrosity simulates how one can process a pack received in async-io by transforming it into
200 // blocking io::BufRead, while still handling the whole operation in a way that won't block the executor.200 // blocking io::BufRead, while still handling the whole operation in a way that won't block the executor.
201 // It's a way of `spawn_blocking()` in other executors. Currently this can only be done on a per-command basis.201 // It's a way of `spawn_blocking()` in other executors. Currently this can only be done on a per-command basis.
202 // Thinking about it, it's most certainly fine to do `fetch' commands on another thread and move the entire conenction202 // Thinking about it, it's most certainly fine to do `fetch' commands on another thread and move the entire connection
203 // there as it's always the end of an operation and a lot of IO is required that is blocking anyway, like accessing203 // there as it's always the end of an operation and a lot of IO is required that is blocking anyway, like accessing
204 // commit graph information for fetch negotiations, and of cource processing a received pack.204 // commit graph information for fetch negotiations, and of course processing a received pack.
205 #[cfg(feature = "async-client")]205 #[cfg(feature = "async-client")]
206 Ok(206 Ok(
207 blocking::unblock(|| futures_lite::future::block_on(handshake_v2_and_request_inner()).expect("no failure"))207 blocking::unblock(|| futures_lite::future::block_on(handshake_v2_and_request_inner()).expect("no failure"))
git-traverse/src/commit.rs+1−1
@@ -27,7 +27,7 @@ impl Default for Parents { · 26 unmodified lines
27pub enum Sorting {27pub enum Sorting {
28 /// Commits are sorted as they are mentioned in the commit graph.28 /// Commits are sorted as they are mentioned in the commit graph.
29 Topological,29 Topological,
30 /// Commits are sorted by their commit time in decending order, that is newest first.30 /// Commits are sorted by their commit time in descending order, that is newest first.
31 ///31 ///
32 /// The sorting applies to all currently queued commit ids and thus is full.32 /// The sorting applies to all currently queued commit ids and thus is full.
33 ByCommitTimeNewestFirst,33 ByCommitTimeNewestFirst,
git-worktree/src/fs/cache/state.rs+2−2
@@ -102,10 +102,10 @@ impl Ignore { · 101 unmodified lines
102 if mapping.pattern.is_negative() {102 if mapping.pattern.is_negative() {
103 dir_match = Some(match_);103 dir_match = Some(match_);
104 } else {104 } else {
105 // Note that returning here is wrong if this pattern _was_ preceeded by a negative pattern that105 // Note that returning here is wrong if this pattern _was_ preceded by a negative pattern that
106 // didn't match the directory, but would match now.106 // didn't match the directory, but would match now.
107 // Git does it similarly so we do too even though it's incorrect.107 // Git does it similarly so we do too even though it's incorrect.
108 // To fix this, one would probably keep track of whether there was a preceeding negative pattern, and108 // To fix this, one would probably keep track of whether there was a preceding negative pattern, and
109 // if so we check the path in full and only use the dir match if there was no match, similar to the negative109 // if so we check the path in full and only use the dir match if there was no match, similar to the negative
110 // case above whose fix fortunately won't change the overall result.110 // case above whose fix fortunately won't change the overall result.
111 return match_.into();111 return match_.into();
gitoxide-core/Cargo.toml+1−1
@@ -1,6 +1,6 @@
1[package]1[package]
2name = "gitoxide-core"2name = "gitoxide-core"
3description = "The library implementating all capabilities of the gitoxide CLI"3description = "The library implementing all capabilities of the gitoxide CLI"
4repository = "https://github.com/Byron/gitoxide"4repository = "https://github.com/Byron/gitoxide"
5version = "0.15.0"5version = "0.15.0"
6authors = ["Sebastian Thiel <sebastian.thiel@icloud.com>"]6authors = ["Sebastian Thiel <sebastian.thiel@icloud.com>"]
gitoxide-core/src/net.rs+1−1
@@ -36,7 +36,7 @@ mod impls { · 35 unmodified lines
36 36
37impl Default for Protocol {37impl Default for Protocol {
38 fn default() -> Self {38 fn default() -> Self {
39 // Note that it's very important this remains V2, as V1 may block forver in stateful (i.e. non-http) connections when fetching39 // Note that it's very important this remains V2, as V1 may block forever in stateful (i.e. non-http) connections when fetching
40 // as we chose not to complicate matters by counting which arguments where sent (just yet).40 // as we chose not to complicate matters by counting which arguments where sent (just yet).
41 Protocol::V241 Protocol::V2
42 }42 }
gitoxide-core/src/pack/create.rs+1−1
@@ -66,7 +66,7 @@ impl From<ObjectExpansion> for pack::data::output::count::objects::ObjectExpansi · 65 unmodified lines
66pub struct Context<W> {66pub struct Context<W> {
67 /// The way input objects should be handled67 /// The way input objects should be handled
68 pub expansion: ObjectExpansion,68 pub expansion: ObjectExpansion,
69 /// If `Some(threads)`, use this amount of `threads` to accelerate the counting phase at the cost of loosing69 /// If `Some(threads)`, use this amount of `threads` to accelerate the counting phase at the cost of losing
70 /// determinism as the order of objects during expansion changes with multiple threads unless no expansion is performed.70 /// determinism as the order of objects during expansion changes with multiple threads unless no expansion is performed.
71 /// In the latter case, this flag has no effect.71 /// In the latter case, this flag has no effect.
72 /// If `None`, counting will only use one thread and thus yield the same sequence of objects in any case.72 /// If `None`, counting will only use one thread and thus yield the same sequence of objects in any case.
src/plumbing/options.rs+1−1
@@ -484,7 +484,7 @@ pub mod free { · 483 unmodified lines
484 /// This flag is primarily to test the implementation of encoding, and requires to decode the object first.484 /// This flag is primarily to test the implementation of encoding, and requires to decode the object first.
485 /// Encoding an object after decoding it should yield exactly the same bytes.485 /// Encoding an object after decoding it should yield exactly the same bytes.
486 /// This will reduce overall performance even more, as re-encoding requires to transform zero-copy objects into486 /// This will reduce overall performance even more, as re-encoding requires to transform zero-copy objects into
487 /// owned objects, causing plenty of allocation to occour.487 /// owned objects, causing plenty of allocation to occur.
488 pub re_encode: bool,488 pub re_encode: bool,
489 }489 }
490 490