This effectively pulls down a higher-level implementation in `gix` to the plumbing level, to allow it to be used there as well.
Unified · Split
| @@ -601,6 +601,18 @@ dependencies = [ · 600 unmodified lines | ||
| 601 | 601 | "windows 0.44.0", |
| 602 | 602 | ] |
| 603 | 603 | |
| 604 | +[[package]] | |
| 605 | +name = "console" | |
| 606 | +version = "0.15.8" | |
| 607 | +source = "registry+https://github.com/rust-lang/crates.io-index" | |
| 608 | +checksum = "0e1f83fc076bd6dd27517eacdf25fef6c4dfe5f1d7448bafaaf3a26f13b5e4eb" | |
| 609 | +dependencies = [ | |
| 610 | + "encode_unicode", | |
| 611 | + "lazy_static", | |
| 612 | + "libc", | |
| 613 | + "windows-sys 0.52.0", | |
| 614 | +] | |
| 615 | + | |
| 604 | 616 | [[package]] |
| 605 | 617 | name = "core-foundation" |
| 606 | 618 | version = "0.9.4" |
| @@ -919,6 +931,12 @@ version = "1.13.0" · 312 unmodified lines | ||
| 919 | 931 | source = "registry+https://github.com/rust-lang/crates.io-index" |
| 920 | 932 | checksum = "60b1af1c220855b6ceac025d3f6ecdd2b7c4894bfe9cd9bda4fbb4bc7c0d4cf0" |
| 921 | 933 | |
| 934 | +[[package]] | |
| 935 | +name = "encode_unicode" | |
| 936 | +version = "0.3.6" | |
| 937 | +source = "registry+https://github.com/rust-lang/crates.io-index" | |
| 938 | +checksum = "a357d28ed41a50f9c765dbfe56cbc04a64e53e5fc58ba79fbc34c10ef3df831f" | |
| 939 | + | |
| 922 | 940 | [[package]] |
| 923 | 941 | name = "encoding_rs" |
| 924 | 942 | version = "0.8.34" |
| @@ -1650,6 +1668,7 @@ dependencies = [ · 725 unmodified lines | ||
| 1650 | 1668 | "gix-path 0.10.11", |
| 1651 | 1669 | "gix-tempfile 14.0.2", |
| 1652 | 1670 | "gix-trace 0.1.10", |
| 1671 | + "gix-traverse 0.41.0", | |
| 1653 | 1672 | "gix-worktree 0.36.0", |
| 1654 | 1673 | "imara-diff", |
| 1655 | 1674 | "serde", |
| @@ -1669,6 +1688,7 @@ dependencies = [ · 13 unmodified lines | ||
| 1669 | 1688 | "gix-testtools", |
| 1670 | 1689 | "gix-traverse 0.41.0", |
| 1671 | 1690 | "gix-worktree 0.36.0", |
| 1691 | + "insta", | |
| 1672 | 1692 | "pretty_assertions", |
| 1673 | 1693 | "shell-words", |
| 1674 | 1694 | ] |
| @@ -3127,6 +3147,18 @@ dependencies = [ · 1452 unmodified lines | ||
| 3127 | 3147 | "hashbrown", |
| 3128 | 3148 | ] |
| 3129 | 3149 | |
| 3150 | +[[package]] | |
| 3151 | +name = "insta" | |
| 3152 | +version = "1.40.0" | |
| 3153 | +source = "registry+https://github.com/rust-lang/crates.io-index" | |
| 3154 | +checksum = "6593a41c7a73841868772495db7dc1e8ecab43bb5c0b6da2059246c4b506ab60" | |
| 3155 | +dependencies = [ | |
| 3156 | + "console", | |
| 3157 | + "lazy_static", | |
| 3158 | + "linked-hash-map", | |
| 3159 | + "similar", | |
| 3160 | +] | |
| 3161 | + | |
| 3130 | 3162 | [[package]] |
| 3131 | 3163 | name = "instant" |
| 3132 | 3164 | version = "0.1.13" |
| @@ -3382,6 +3414,12 @@ dependencies = [ · 249 unmodified lines | ||
| 3382 | 3414 | "vcpkg", |
| 3383 | 3415 | ] |
| 3384 | 3416 | |
| 3417 | +[[package]] | |
| 3418 | +name = "linked-hash-map" | |
| 3419 | +version = "0.5.6" | |
| 3420 | +source = "registry+https://github.com/rust-lang/crates.io-index" | |
| 3421 | +checksum = "0717cef1bc8b636c6e1c1bbdefc09e6322da8a9321966e8928ef80d20f7f770f" | |
| 3422 | + | |
| 3385 | 3423 | [[package]] |
| 3386 | 3424 | name = "linux-raw-sys" |
| 3387 | 3425 | version = "0.3.8" |
| @@ -4496,6 +4534,12 @@ version = "0.3.7" · 1108 unmodified lines | ||
| 4496 | 4534 | source = "registry+https://github.com/rust-lang/crates.io-index" |
| 4497 | 4535 | checksum = "d66dc143e6b11c1eddc06d5c423cfc97062865baf299914ab64caa38182078fe" |
| 4498 | 4536 | |
| 4537 | +[[package]] | |
| 4538 | +name = "similar" | |
| 4539 | +version = "2.6.0" | |
| 4540 | +source = "registry+https://github.com/rust-lang/crates.io-index" | |
| 4541 | +checksum = "1de1d4f81173b03af4c0cbed3c898f6bff5b870e4a7f5d6f4057d62a7a4b686e" | |
| 4542 | + | |
| 4499 | 4543 | [[package]] |
| 4500 | 4544 | name = "slab" |
| 4501 | 4545 | version = "0.4.9" |
| @@ -194,8 +194,9 @@ serde_derive = ">=1.0.185" · 193 unmodified lines | ||
| 194 | 194 | |
| 195 | 195 | once_cell = "1.18.0" |
| 196 | 196 | document-features = { version = "0.2.0", optional = true } |
| 197 | − | |
| 198 | 197 | [profile.dev.package] |
| 198 | +insta.opt-level = 3 | |
| 199 | +similar.opt-level = 3 | |
| 199 | 200 | gix-object = { opt-level = 3 } |
| 200 | 201 | gix-ref = { opt-level = 3 } |
| 201 | 202 | #gix-pack = { opt-level = 3 } |
| @@ -15,7 +15,7 @@ autotests = false · 14 unmodified lines | ||
| 15 | 15 | [features] |
| 16 | 16 | default = ["blob"] |
| 17 | 17 | ## Enable diffing of blobs using imara-diff, which also allows for a generic rewrite tracking implementation. |
| 18 | −blob = ["dep:imara-diff", "dep:gix-filter", "dep:gix-worktree", "dep:gix-path", "dep:gix-fs", "dep:gix-command", "dep:gix-tempfile", "dep:gix-trace"] | |
| 18 | +blob = ["dep:imara-diff", "dep:gix-filter", "dep:gix-worktree", "dep:gix-path", "dep:gix-fs", "dep:gix-command", "dep:gix-tempfile", "dep:gix-trace", "dep:gix-traverse"] | |
| 19 | 19 | ## Data structures implement `serde::Serialize` and `serde::Deserialize`. |
| 20 | 20 | serde = ["dep:serde", "gix-hash/serde", "gix-object/serde"] |
| 21 | 21 | ## Make it possible to compile to the `wasm32-unknown-unknown` target. |
| @@ -34,6 +34,7 @@ gix-path = { version = "^0.10.11", path = "../gix-path", optional = true } · 12 unmodified lines | ||
| 34 | 34 | gix-fs = { version = "^0.11.3", path = "../gix-fs", optional = true } |
| 35 | 35 | gix-tempfile = { version = "^14.0.0", path = "../gix-tempfile", optional = true } |
| 36 | 36 | gix-trace = { version = "^0.1.10", path = "../gix-trace", optional = true } |
| 37 | +gix-traverse = { version = "^0.41.0", path = "../gix-traverse", optional = true } | |
| 37 | 38 | |
| 38 | 39 | thiserror = "1.0.32" |
| 39 | 40 | imara-diff = { version = "0.1.7", optional = true } |
| @@ -47,6 +47,12 @@ pub mod rewrites; · 46 unmodified lines | ||
| 47 | 47 | pub mod tree; |
| 48 | 48 | pub use tree::function::diff as tree; |
| 49 | 49 | |
| 50 | +/// | |
| 51 | +#[cfg(feature = "blob")] | |
| 52 | +pub mod tree_with_rewrites; | |
| 53 | +#[cfg(feature = "blob")] | |
| 54 | +pub use tree_with_rewrites::function::diff as tree_with_rewrites; | |
| 55 | + | |
| 50 | 56 | /// |
| 51 | 57 | #[cfg(feature = "blob")] |
| 52 | 58 | pub mod blob; |
| @@ -0,0 +1,480 @@ | ||
| 1 | +use crate::blob::{DiffLineStats, ResourceKind}; | |
| 2 | +use crate::tree; | |
| 3 | +use bstr::BString; | |
| 4 | +use bstr::{BStr, ByteSlice}; | |
| 5 | + | |
| 6 | +/// Represents any possible change in order to turn one tree into another, which references data owned by its producer. | |
| 7 | +#[derive(Debug, Clone, Copy)] | |
| 8 | +pub enum ChangeRef<'a> { | |
| 9 | + /// An entry was added, like the addition of a file or directory. | |
| 10 | + Addition { | |
| 11 | + /// The location of the file or directory. | |
| 12 | + /// | |
| 13 | + /// It may be empty if [file names](super::Options::location) is `None`. | |
| 14 | + location: &'a BStr, | |
| 15 | + /// The mode of the added entry. | |
| 16 | + entry_mode: gix_object::tree::EntryMode, | |
| 17 | + /// Identifies a relationship between this instance and another one, | |
| 18 | + /// making it easy to reconstruct the top-level of directory changes. | |
| 19 | + relation: Option<tree::visit::Relation>, | |
| 20 | + /// The object id of the added entry. | |
| 21 | + id: gix_hash::ObjectId, | |
| 22 | + }, | |
| 23 | + /// An entry was deleted, like the deletion of a file or directory. | |
| 24 | + Deletion { | |
| 25 | + /// The location of the file or directory. | |
| 26 | + /// | |
| 27 | + /// It may be empty if [file names](super::Options::location) is `None`. | |
| 28 | + /// are tracked. | |
| 29 | + location: &'a BStr, | |
| 30 | + /// The mode of the deleted entry. | |
| 31 | + entry_mode: gix_object::tree::EntryMode, | |
| 32 | + /// Identifies a relationship between this instance and another one, | |
| 33 | + /// making it easy to reconstruct the top-level of directory changes. | |
| 34 | + relation: Option<tree::visit::Relation>, | |
| 35 | + /// The object id of the deleted entry. | |
| 36 | + id: gix_hash::ObjectId, | |
| 37 | + }, | |
| 38 | + /// An entry was modified, e.g. changing the contents of a file adjusts its object id and turning | |
| 39 | + /// a file into a symbolic link adjusts its mode. | |
| 40 | + Modification { | |
| 41 | + /// The location of the file or directory. | |
| 42 | + /// | |
| 43 | + /// It may be empty if [file names](super::Options::location) is `None`. | |
| 44 | + /// are tracked. | |
| 45 | + location: &'a BStr, | |
| 46 | + /// The mode of the entry before the modification. | |
| 47 | + previous_entry_mode: gix_object::tree::EntryMode, | |
| 48 | + /// The object id of the entry before the modification. | |
| 49 | + previous_id: gix_hash::ObjectId, | |
| 50 | + | |
| 51 | + /// The mode of the entry after the modification. | |
| 52 | + entry_mode: gix_object::tree::EntryMode, | |
| 53 | + /// The object id after the modification. | |
| 54 | + id: gix_hash::ObjectId, | |
| 55 | + }, | |
| 56 | + /// Entries are considered rewritten if they are not trees and they, according to some understanding of identity, were renamed | |
| 57 | + /// or copied. | |
| 58 | + /// In case of renames, this means they originally appeared as [`Deletion`](ChangeRef::Deletion) signalling their source as well as an | |
| 59 | + /// [`Addition`](ChangeRef::Addition) acting as destination. | |
| 60 | + /// | |
| 61 | + /// In case of copies, the `copy` flag is true and typically represents a perfect copy of a source was made. | |
| 62 | + /// | |
| 63 | + /// This variant can only be encountered if [rewrite tracking](super::Options::rewrites) is enabled. | |
| 64 | + /// | |
| 65 | + /// Note that mode changes may have occurred as well, i.e. changes from executable to non-executable or vice-versa. | |
| 66 | + Rewrite { | |
| 67 | + /// The location of the source of the rename or copy operation. | |
| 68 | + /// | |
| 69 | + /// It may be empty if [file names](super::Options::location) is `None`. | |
| 70 | + /// are tracked. | |
| 71 | + source_location: &'a BStr, | |
| 72 | + /// The mode of the entry before the rename. | |
| 73 | + source_entry_mode: gix_object::tree::EntryMode, | |
| 74 | + /// Identifies a relationship between the source and another source, | |
| 75 | + /// making it easy to reconstruct the top-level of directory changes. | |
| 76 | + source_relation: Option<tree::visit::Relation>, | |
| 77 | + /// The object id of the entry before the rename. | |
| 78 | + /// | |
| 79 | + /// Note that this is the same as `id` if we require the [similarity to be 100%](super::Rewrites::percentage), but may | |
| 80 | + /// be different otherwise. | |
| 81 | + source_id: gix_hash::ObjectId, | |
| 82 | + /// Information about the diff we performed to detect similarity and match the `source_id` with the current state at `id`. | |
| 83 | + /// It's `None` if `source_id` is equal to `id`, as identity made an actual diff computation unnecessary. | |
| 84 | + diff: Option<DiffLineStats>, | |
| 85 | + /// The mode of the entry after the rename. | |
| 86 | + /// It could differ but still be considered a rename as we are concerned only about content. | |
| 87 | + entry_mode: gix_object::tree::EntryMode, | |
| 88 | + /// The object id after the rename. | |
| 89 | + id: gix_hash::ObjectId, | |
| 90 | + /// The location after the rename or copy operation. | |
| 91 | + /// | |
| 92 | + /// It may be empty if [file names](super::Options::location) is `None`. | |
| 93 | + location: &'a BStr, | |
| 94 | + /// Identifies a relationship between this destination and another destination, | |
| 95 | + /// making it easy to reconstruct the top-level of directory changes. | |
| 96 | + relation: Option<tree::visit::Relation>, | |
| 97 | + /// If true, this rewrite is created by copy, and `source_id` is pointing to its source. Otherwise, it's a rename, and `source_id` | |
| 98 | + /// points to a deleted object, as renames are tracked as deletions and additions of the same or similar content. | |
| 99 | + copy: bool, | |
| 100 | + }, | |
| 101 | +} | |
| 102 | + | |
| 103 | +/// Represents any possible change in order to turn one tree into another, with fully-owned data. | |
| 104 | +#[derive(Debug, Clone)] | |
| 105 | +pub enum Change { | |
| 106 | + /// An entry was added, like the addition of a file or directory. | |
| 107 | + Addition { | |
| 108 | + /// The location of the file or directory. | |
| 109 | + /// | |
| 110 | + /// It may be empty if [file names](super::Options::location) is `None`. | |
| 111 | + location: BString, | |
| 112 | + /// Identifies a relationship between this instance and another one, | |
| 113 | + /// making it easy to reconstruct the top-level of directory changes. | |
| 114 | + relation: Option<tree::visit::Relation>, | |
| 115 | + /// The mode of the added entry. | |
| 116 | + entry_mode: gix_object::tree::EntryMode, | |
| 117 | + /// The object id of the added entry. | |
| 118 | + id: gix_hash::ObjectId, | |
| 119 | + }, | |
| 120 | + /// An entry was deleted, like the deletion of a file or directory. | |
| 121 | + Deletion { | |
| 122 | + /// The location of the file or directory. | |
| 123 | + /// | |
| 124 | + /// It may be empty if [file names](super::Options::location) is `None`. | |
| 125 | + location: BString, | |
| 126 | + /// Identifies a relationship between this instance and another one, | |
| 127 | + /// making it easy to reconstruct the top-level of directory changes. | |
| 128 | + relation: Option<tree::visit::Relation>, | |
| 129 | + /// The mode of the deleted entry. | |
| 130 | + entry_mode: gix_object::tree::EntryMode, | |
| 131 | + /// The object id of the deleted entry. | |
| 132 | + id: gix_hash::ObjectId, | |
| 133 | + }, | |
| 134 | + /// An entry was modified, e.g. changing the contents of a file adjusts its object id and turning | |
| 135 | + /// a file into a symbolic link adjusts its mode. | |
| 136 | + Modification { | |
| 137 | + /// The location of the file or directory. | |
| 138 | + /// | |
| 139 | + /// It may be empty if [file names](super::Options::location) is `None`. | |
| 140 | + location: BString, | |
| 141 | + /// The mode of the entry before the modification. | |
| 142 | + previous_entry_mode: gix_object::tree::EntryMode, | |
| 143 | + /// The object id of the entry before the modification. | |
| 144 | + previous_id: gix_hash::ObjectId, | |
| 145 | + | |
| 146 | + /// The mode of the entry after the modification. | |
| 147 | + entry_mode: gix_object::tree::EntryMode, | |
| 148 | + /// The object id after the modification. | |
| 149 | + id: gix_hash::ObjectId, | |
| 150 | + }, | |
| 151 | + /// Entries are considered rewritten if they are not trees and they, according to some understanding of identity, were renamed | |
| 152 | + /// or copied. | |
| 153 | + /// In case of renames, this means they originally appeared as [`Deletion`](ChangeRef::Deletion) signalling their source as well as an | |
| 154 | + /// [`Addition`](ChangeRef::Addition) acting as destination. | |
| 155 | + /// | |
| 156 | + /// In case of copies, the `copy` flag is true and typically represents a perfect copy of a source was made. | |
| 157 | + /// | |
| 158 | + /// This variant can only be encountered if [rewrite tracking](super::Options::rewrites) is enabled. | |
| 159 | + /// | |
| 160 | + /// Note that mode changes may have occurred as well, i.e. changes from executable to non-executable or vice-versa. | |
| 161 | + Rewrite { | |
| 162 | + /// The location of the source of the rename operation. | |
| 163 | + /// | |
| 164 | + /// It may be empty if [file names](super::Options::location) is `None`. | |
| 165 | + source_location: BString, | |
| 166 | + /// The mode of the entry before the rename. | |
| 167 | + source_entry_mode: gix_object::tree::EntryMode, | |
| 168 | + /// Identifies a relationship between the source and another source, | |
| 169 | + /// making it easy to reconstruct the top-level of directory changes. | |
| 170 | + source_relation: Option<tree::visit::Relation>, | |
| 171 | + /// The object id of the entry before the rename. | |
| 172 | + /// | |
| 173 | + /// Note that this is the same as `id` if we require the [similarity to be 100%](super::Rewrites::percentage), but may | |
| 174 | + /// be different otherwise. | |
| 175 | + source_id: gix_hash::ObjectId, | |
| 176 | + /// Information about the diff we performed to detect similarity and match the `source_id` with the current state at `id`. | |
| 177 | + /// It's `None` if `source_id` is equal to `id`, as identity made an actual diff computation unnecessary. | |
| 178 | + diff: Option<DiffLineStats>, | |
| 179 | + /// The mode of the entry after the rename. | |
| 180 | + /// It could differ but still be considered a rename as we are concerned only about content. | |
| 181 | + entry_mode: gix_object::tree::EntryMode, | |
| 182 | + /// The object id after the rename. | |
| 183 | + id: gix_hash::ObjectId, | |
| 184 | + /// The location after the rename or copy operation. | |
| 185 | + /// | |
| 186 | + /// It may be empty if [file names](super::Options::location) is `None`. | |
| 187 | + location: BString, | |
| 188 | + /// Identifies a relationship between this destination and another destination, | |
| 189 | + /// making it easy to reconstruct the top-level of directory changes. | |
| 190 | + relation: Option<tree::visit::Relation>, | |
| 191 | + /// If true, this rewrite is created by copy, and `source_id` is pointing to its source. Otherwise, it's a rename, and `source_id` | |
| 192 | + /// points to a deleted object, as renames are tracked as deletions and additions of the same or similar content. | |
| 193 | + copy: bool, | |
| 194 | + }, | |
| 195 | +} | |
| 196 | + | |
| 197 | +/// Lifecycle | |
| 198 | +impl ChangeRef<'_> { | |
| 199 | + /// Copy this instance into a fully-owned version | |
| 200 | + pub fn into_owned(self) -> Change { | |
| 201 | + match self { | |
| 202 | + ChangeRef::Addition { | |
| 203 | + location, | |
| 204 | + entry_mode, | |
| 205 | + id, | |
| 206 | + relation, | |
| 207 | + } => Change::Addition { | |
| 208 | + location: location.to_owned(), | |
| 209 | + entry_mode, | |
| 210 | + id, | |
| 211 | + relation, | |
| 212 | + }, | |
| 213 | + ChangeRef::Deletion { | |
| 214 | + location, | |
| 215 | + entry_mode, | |
| 216 | + id, | |
| 217 | + relation, | |
| 218 | + } => Change::Deletion { | |
| 219 | + location: location.to_owned(), | |
| 220 | + entry_mode, | |
| 221 | + id, | |
| 222 | + relation, | |
| 223 | + }, | |
| 224 | + ChangeRef::Modification { | |
| 225 | + location, | |
| 226 | + previous_entry_mode, | |
| 227 | + previous_id, | |
| 228 | + entry_mode, | |
| 229 | + id, | |
| 230 | + } => Change::Modification { | |
| 231 | + location: location.to_owned(), | |
| 232 | + previous_entry_mode, | |
| 233 | + previous_id, | |
| 234 | + entry_mode, | |
| 235 | + id, | |
| 236 | + }, | |
| 237 | + ChangeRef::Rewrite { | |
| 238 | + source_location, | |
| 239 | + source_relation, | |
| 240 | + source_entry_mode, | |
| 241 | + source_id, | |
| 242 | + diff, | |
| 243 | + entry_mode, | |
| 244 | + id, | |
| 245 | + location, | |
| 246 | + relation, | |
| 247 | + copy, | |
| 248 | + } => Change::Rewrite { | |
| 249 | + source_location: source_location.to_owned(), | |
| 250 | + source_relation, | |
| 251 | + source_entry_mode, | |
| 252 | + source_id, | |
| 253 | + diff, | |
| 254 | + entry_mode, | |
| 255 | + id, | |
| 256 | + location: location.to_owned(), | |
| 257 | + relation, | |
| 258 | + copy, | |
| 259 | + }, | |
| 260 | + } | |
| 261 | + } | |
| 262 | +} | |
| 263 | + | |
| 264 | +/// Lifecycle | |
| 265 | +impl Change { | |
| 266 | + /// Return an attached version of this instance that uses `old_repo` for previous values and `new_repo` for current values. | |
| 267 | + pub fn to_ref(&self) -> ChangeRef<'_> { | |
| 268 | + match self { | |
| 269 | + Change::Addition { | |
| 270 | + location, | |
| 271 | + relation, | |
| 272 | + entry_mode, | |
| 273 | + id, | |
| 274 | + } => ChangeRef::Addition { | |
| 275 | + location: location.as_bstr(), | |
| 276 | + entry_mode: *entry_mode, | |
| 277 | + id: *id, | |
| 278 | + relation: *relation, | |
| 279 | + }, | |
| 280 | + Change::Deletion { | |
| 281 | + location, | |
| 282 | + relation, | |
| 283 | + entry_mode, | |
| 284 | + id, | |
| 285 | + } => ChangeRef::Deletion { | |
| 286 | + location: location.as_bstr(), | |
| 287 | + entry_mode: *entry_mode, | |
| 288 | + id: *id, | |
| 289 | + relation: *relation, | |
| 290 | + }, | |
| 291 | + Change::Modification { | |
| 292 | + location, | |
| 293 | + previous_entry_mode, | |
| 294 | + previous_id, | |
| 295 | + entry_mode, | |
| 296 | + id, | |
| 297 | + } => ChangeRef::Modification { | |
| 298 | + location: location.as_bstr(), | |
| 299 | + previous_entry_mode: *previous_entry_mode, | |
| 300 | + previous_id: *previous_id, | |
| 301 | + entry_mode: *entry_mode, | |
| 302 | + id: *id, | |
| 303 | + }, | |
| 304 | + Change::Rewrite { | |
| 305 | + source_location, | |
| 306 | + source_relation, | |
| 307 | + source_entry_mode, | |
| 308 | + source_id, | |
| 309 | + diff, | |
| 310 | + entry_mode, | |
| 311 | + id, | |
| 312 | + location, | |
| 313 | + relation, | |
| 314 | + copy, | |
| 315 | + } => ChangeRef::Rewrite { | |
| 316 | + source_location: source_location.as_ref(), | |
| 317 | + source_relation: *source_relation, | |
| 318 | + source_entry_mode: *source_entry_mode, | |
| 319 | + source_id: *source_id, | |
| 320 | + diff: *diff, | |
| 321 | + entry_mode: *entry_mode, | |
| 322 | + id: *id, | |
| 323 | + location: location.as_bstr(), | |
| 324 | + relation: *relation, | |
| 325 | + copy: *copy, | |
| 326 | + }, | |
| 327 | + } | |
| 328 | + } | |
| 329 | +} | |
| 330 | + | |
| 331 | +impl crate::blob::Platform { | |
| 332 | + /// Set ourselves up to produces blob-diffs from `change`, so this platform can be used to produce diffs easily. | |
| 333 | + /// `objects` are used to fetch object data as needed. | |
| 334 | + /// | |
| 335 | + /// ### Warning about Memory Consumption | |
| 336 | + /// | |
| 337 | + /// This instance only grows, so one should call [`crate::blob::Platform::clear_resource_cache`] occasionally. | |
| 338 | + pub fn set_resource_by_change( | |
| 339 | + &mut self, | |
| 340 | + change: ChangeRef<'_>, | |
| 341 | + objects: &impl gix_object::FindObjectOrHeader, | |
| 342 | + ) -> Result<&mut Self, crate::blob::platform::set_resource::Error> { | |
| 343 | + match change { | |
| 344 | + ChangeRef::Addition { | |
| 345 | + location, | |
| 346 | + relation: _, | |
| 347 | + entry_mode, | |
| 348 | + id, | |
| 349 | + } => { | |
| 350 | + self.set_resource( | |
| 351 | + id.kind().null(), | |
| 352 | + entry_mode.kind(), | |
| 353 | + location, | |
| 354 | + ResourceKind::OldOrSource, | |
| 355 | + objects, | |
| 356 | + )?; | |
| 357 | + self.set_resource(id, entry_mode.kind(), location, ResourceKind::NewOrDestination, objects)?; | |
| 358 | + } | |
| 359 | + ChangeRef::Deletion { | |
| 360 | + location, | |
| 361 | + relation: _, | |
| 362 | + entry_mode, | |
| 363 | + id, | |
| 364 | + } => { | |
| 365 | + self.set_resource(id, entry_mode.kind(), location, ResourceKind::OldOrSource, objects)?; | |
| 366 | + self.set_resource( | |
| 367 | + id.kind().null(), | |
| 368 | + entry_mode.kind(), | |
| 369 | + location, | |
| 370 | + ResourceKind::NewOrDestination, | |
| 371 | + objects, | |
| 372 | + )?; | |
| 373 | + } | |
| 374 | + ChangeRef::Modification { | |
| 375 | + location, | |
| 376 | + previous_entry_mode, | |
| 377 | + previous_id, | |
| 378 | + entry_mode, | |
| 379 | + id, | |
| 380 | + } => { | |
| 381 | + self.set_resource( | |
| 382 | + previous_id, | |
| 383 | + previous_entry_mode.kind(), | |
| 384 | + location, | |
| 385 | + ResourceKind::OldOrSource, | |
| 386 | + objects, | |
| 387 | + )?; | |
| 388 | + self.set_resource(id, entry_mode.kind(), location, ResourceKind::NewOrDestination, objects)?; | |
| 389 | + } | |
| 390 | + ChangeRef::Rewrite { | |
| 391 | + source_location, | |
| 392 | + source_relation: _, | |
| 393 | + source_entry_mode, | |
| 394 | + source_id, | |
| 395 | + entry_mode, | |
| 396 | + id, | |
| 397 | + location, | |
| 398 | + relation: _, | |
| 399 | + diff: _, | |
| 400 | + copy: _, | |
| 401 | + } => { | |
| 402 | + self.set_resource( | |
| 403 | + source_id, | |
| 404 | + source_entry_mode.kind(), | |
| 405 | + source_location, | |
| 406 | + ResourceKind::OldOrSource, | |
| 407 | + objects, | |
| 408 | + )?; | |
| 409 | + self.set_resource(id, entry_mode.kind(), location, ResourceKind::NewOrDestination, objects)?; | |
| 410 | + } | |
| 411 | + } | |
| 412 | + Ok(self) | |
| 413 | + } | |
| 414 | +} | |
| 415 | + | |
| 416 | +impl<'a> ChangeRef<'a> { | |
| 417 | + /// Return the relation this instance may have to other changes. | |
| 418 | + pub fn relation(&self) -> Option<tree::visit::Relation> { | |
| 419 | + match self { | |
| 420 | + ChangeRef::Addition { relation, .. } | |
| 421 | + | ChangeRef::Deletion { relation, .. } | |
| 422 | + | ChangeRef::Rewrite { relation, .. } => *relation, | |
| 423 | + ChangeRef::Modification { .. } => None, | |
| 424 | + } | |
| 425 | + } | |
| 426 | + | |
| 427 | + /// Return the current mode of this instance. | |
| 428 | + pub fn entry_mode(&self) -> gix_object::tree::EntryMode { | |
| 429 | + match self { | |
| 430 | + ChangeRef::Addition { entry_mode, .. } | |
| 431 | + | ChangeRef::Deletion { entry_mode, .. } | |
| 432 | + | ChangeRef::Modification { entry_mode, .. } | |
| 433 | + | ChangeRef::Rewrite { entry_mode, .. } => *entry_mode, | |
| 434 | + } | |
| 435 | + } | |
| 436 | + | |
| 437 | + /// Return the *current* location of the resource, i.e. the destination of a rename or copy, or the | |
| 438 | + /// location at which an addition, deletion or modification took place. | |
| 439 | + pub fn location(&self) -> &'a BStr { | |
| 440 | + match self { | |
| 441 | + ChangeRef::Addition { location, .. } | |
| 442 | + | ChangeRef::Deletion { location, .. } | |
| 443 | + | ChangeRef::Modification { location, .. } | |
| 444 | + | ChangeRef::Rewrite { location, .. } => location, | |
| 445 | + } | |
| 446 | + } | |
| 447 | +} | |
| 448 | + | |
| 449 | +impl Change { | |
| 450 | + /// Return the relation this instance may have to other changes. | |
| 451 | + pub fn relation(&self) -> Option<tree::visit::Relation> { | |
| 452 | + match self { | |
| 453 | + Change::Addition { relation, .. } | |
| 454 | + | Change::Deletion { relation, .. } | |
| 455 | + | Change::Rewrite { relation, .. } => *relation, | |
| 456 | + Change::Modification { .. } => None, | |
| 457 | + } | |
| 458 | + } | |
| 459 | + | |
| 460 | + /// Return the current mode of this instance. | |
| 461 | + pub fn entry_mode(&self) -> gix_object::tree::EntryMode { | |
| 462 | + match self { | |
| 463 | + Change::Addition { entry_mode, .. } | |
| 464 | + | Change::Deletion { entry_mode, .. } | |
| 465 | + | Change::Modification { entry_mode, .. } | |
| 466 | + | Change::Rewrite { entry_mode, .. } => *entry_mode, | |
| 467 | + } | |
| 468 | + } | |
| 469 | + | |
| 470 | + /// Return the *current* location of the resource, i.e. the destination of a rename or copy, or the | |
| 471 | + /// location at which an addition, deletion or modification took place. | |
| 472 | + pub fn location(&self) -> &BStr { | |
| 473 | + match self { | |
| 474 | + Change::Addition { location, .. } | |
| 475 | + | Change::Deletion { location, .. } | |
| 476 | + | Change::Modification { location, .. } | |
| 477 | + | Change::Rewrite { location, .. } => location.as_bstr(), | |
| 478 | + } | |
| 479 | + } | |
| 480 | +} | |
| @@ -0,0 +1,277 @@ | ||
| 1 | +use bstr::BStr; | |
| 2 | +use gix_object::TreeRefIter; | |
| 3 | + | |
| 4 | +use super::{Action, ChangeRef, Error, Options}; | |
| 5 | +use crate::rewrites; | |
| 6 | +use crate::rewrites::tracker; | |
| 7 | + | |
| 8 | +/// Call `for_each` repeatedly with all changes that are needed to convert `lhs` to `rhs`. | |
| 9 | +/// Provide a `resource_cache` to speed up obtaining blobs for similarity checks. | |
| 10 | +/// `tree_diff_state` can be used to re-use tree-diff memory between calls. | |
| 11 | +/// `objects` are used to lookup trees while performing the diff. | |
| 12 | +/// Use `options` to further configure how the rename tracking is performed. | |
| 13 | +/// | |
| 14 | +/// Reusing `resource_cache` between multiple invocations saves a lot of IOps as it avoids the creation | |
| 15 | +/// of a temporary `resource_cache` that triggers reading or checking for multiple gitattribute files. | |
| 16 | +/// Note that it's recommended to call [`clear_resource_cache()`](`crate::blob::Platform::clear_resource_cache()`) | |
| 17 | +/// between the calls to avoid runaway memory usage, as the cache isn't limited. | |
| 18 | +/// | |
| 19 | +/// Note that to do rename tracking like `git` does, one has to configure the `resource_cache` with | |
| 20 | +/// a conversion pipeline that uses [`crate::blob::pipeline::Mode::ToGit`]. | |
| 21 | +/// | |
| 22 | +/// `rhs` or `lhs` can be empty to indicate deletion or addition of an entire tree. | |
| 23 | +/// | |
| 24 | +/// Note that the rewrite outcome is only available if [rewrite-tracking was enabled](Options::rewrites). | |
| 25 | +pub fn diff<E>( | |
| 26 | + lhs: TreeRefIter<'_>, | |
| 27 | + rhs: TreeRefIter<'_>, | |
| 28 | + resource_cache: &mut crate::blob::Platform, | |
| 29 | + tree_diff_state: &mut crate::tree::State, | |
| 30 | + objects: &impl gix_object::FindObjectOrHeader, | |
| 31 | + for_each: impl FnMut(ChangeRef<'_>) -> Result<Action, E>, | |
| 32 | + options: Options, | |
| 33 | +) -> Result<Option<rewrites::Outcome>, Error> | |
| 34 | +where | |
| 35 | + E: Into<Box<dyn std::error::Error + Sync + Send + 'static>>, | |
| 36 | +{ | |
| 37 | + let mut delegate = Delegate { | |
| 38 | + src_tree: lhs, | |
| 39 | + recorder: crate::tree::Recorder::default().track_location(options.location), | |
| 40 | + visit: for_each, | |
| 41 | + location: options.location, | |
| 42 | + objects, | |
| 43 | + tracked: options.rewrites.map(rewrites::Tracker::new), | |
| 44 | + err: None, | |
| 45 | + }; | |
| 46 | + match crate::tree(lhs, rhs, tree_diff_state, objects, &mut delegate) { | |
| 47 | + Ok(()) => { | |
| 48 | + let outcome = delegate.process_tracked_changes(resource_cache)?; | |
| 49 | + match delegate.err { | |
| 50 | + Some(err) => Err(Error::ForEach(err.into())), | |
| 51 | + None => Ok(outcome), | |
| 52 | + } | |
| 53 | + } | |
| 54 | + Err(crate::tree::Error::Cancelled) => delegate | |
| 55 | + .err | |
| 56 | + .map_or(Err(Error::Diff(crate::tree::Error::Cancelled)), |err| { | |
| 57 | + Err(Error::ForEach(err.into())) | |
| 58 | + }), | |
| 59 | + Err(err) => Err(err.into()), | |
| 60 | + } | |
| 61 | +} | |
| 62 | + | |
| 63 | +struct Delegate<'a, 'old, VisitFn, E, Objects> { | |
| 64 | + src_tree: TreeRefIter<'old>, | |
| 65 | + recorder: crate::tree::Recorder, | |
| 66 | + objects: &'a Objects, | |
| 67 | + visit: VisitFn, | |
| 68 | + tracked: Option<rewrites::Tracker<crate::tree::visit::Change>>, | |
| 69 | + location: Option<crate::tree::recorder::Location>, | |
| 70 | + err: Option<E>, | |
| 71 | +} | |
| 72 | + | |
| 73 | +impl<VisitFn, E, Objects> Delegate<'_, '_, VisitFn, E, Objects> | |
| 74 | +where | |
| 75 | + Objects: gix_object::FindObjectOrHeader, | |
| 76 | + VisitFn: for<'delegate> FnMut(ChangeRef<'_>) -> Result<Action, E>, | |
| 77 | + E: Into<Box<dyn std::error::Error + Sync + Send + 'static>>, | |
| 78 | +{ | |
| 79 | + /// Call `visit` on an attached version of `change`. | |
| 80 | + fn emit_change( | |
| 81 | + change: crate::tree::visit::Change, | |
| 82 | + location: &BStr, | |
| 83 | + visit: &mut VisitFn, | |
| 84 | + stored_err: &mut Option<E>, | |
| 85 | + ) -> crate::tree::visit::Action { | |
| 86 | + use crate::tree::visit::Change::*; | |
| 87 | + let change = match change { | |
| 88 | + Addition { | |
| 89 | + entry_mode, | |
| 90 | + oid, | |
| 91 | + relation, | |
| 92 | + } => ChangeRef::Addition { | |
| 93 | + location, | |
| 94 | + relation, | |
| 95 | + entry_mode, | |
| 96 | + id: oid, | |
| 97 | + }, | |
| 98 | + Deletion { | |
| 99 | + entry_mode, | |
| 100 | + oid, | |
| 101 | + relation, | |
| 102 | + } => ChangeRef::Deletion { | |
| 103 | + entry_mode, | |
| 104 | + location, | |
| 105 | + relation, | |
| 106 | + id: oid, | |
| 107 | + }, | |
| 108 | + Modification { | |
| 109 | + previous_entry_mode, | |
| 110 | + previous_oid, | |
| 111 | + entry_mode, | |
| 112 | + oid, | |
| 113 | + } => ChangeRef::Modification { | |
| 114 | + location, | |
| 115 | + previous_entry_mode, | |
| 116 | + entry_mode, | |
| 117 | + previous_id: previous_oid, | |
| 118 | + id: oid, | |
| 119 | + }, | |
| 120 | + }; | |
| 121 | + match visit(change) { | |
| 122 | + Ok(Action::Cancel) => crate::tree::visit::Action::Cancel, | |
| 123 | + Ok(Action::Continue) => crate::tree::visit::Action::Continue, | |
| 124 | + Err(err) => { | |
| 125 | + *stored_err = Some(err); | |
| 126 | + crate::tree::visit::Action::Cancel | |
| 127 | + } | |
| 128 | + } | |
| 129 | + } | |
| 130 | + | |
| 131 | + fn process_tracked_changes( | |
| 132 | + &mut self, | |
| 133 | + diff_cache: &mut crate::blob::Platform, | |
| 134 | + ) -> Result<Option<rewrites::Outcome>, Error> { | |
| 135 | + use crate::rewrites::tracker::Change as _; | |
| 136 | + let tracked = match self.tracked.as_mut() { | |
| 137 | + Some(t) => t, | |
| 138 | + None => return Ok(None), | |
| 139 | + }; | |
| 140 | + | |
| 141 | + let outcome = tracked.emit( | |
| 142 | + |dest, source| match source { | |
| 143 | + Some(source) => { | |
| 144 | + let (oid, mode) = dest.change.oid_and_entry_mode(); | |
| 145 | + let change = ChangeRef::Rewrite { | |
| 146 | + source_location: source.location, | |
| 147 | + source_entry_mode: source.entry_mode, | |
| 148 | + source_id: source.id, | |
| 149 | + source_relation: source.change.relation(), | |
| 150 | + entry_mode: mode, | |
| 151 | + id: oid.to_owned(), | |
| 152 | + relation: dest.change.relation(), | |
| 153 | + diff: source.diff, | |
| 154 | + location: dest.location, | |
| 155 | + copy: match source.kind { | |
| 156 | + tracker::visit::SourceKind::Rename => false, | |
| 157 | + tracker::visit::SourceKind::Copy => true, | |
| 158 | + }, | |
| 159 | + }; | |
| 160 | + match (self.visit)(change) { | |
| 161 | + Ok(Action::Cancel) => crate::tree::visit::Action::Cancel, | |
| 162 | + Ok(Action::Continue) => crate::tree::visit::Action::Continue, | |
| 163 | + Err(err) => { | |
| 164 | + self.err = Some(err); | |
| 165 | + crate::tree::visit::Action::Cancel | |
| 166 | + } | |
| 167 | + } | |
| 168 | + } | |
| 169 | + None => Self::emit_change(dest.change, dest.location, &mut self.visit, &mut self.err), | |
| 170 | + }, | |
| 171 | + diff_cache, | |
| 172 | + self.objects, | |
| 173 | + |push| { | |
| 174 | + let mut delegate = tree_to_changes::Delegate::new(push, self.location); | |
| 175 | + let state = gix_traverse::tree::breadthfirst::State::default(); | |
| 176 | + gix_traverse::tree::breadthfirst(self.src_tree, state, self.objects, &mut delegate) | |
| 177 | + }, | |
| 178 | + )?; | |
| 179 | + Ok(Some(outcome)) | |
| 180 | + } | |
| 181 | +} | |
| 182 | + | |
| 183 | +impl<VisitFn, E, Objects> crate::tree::Visit for Delegate<'_, '_, VisitFn, E, Objects> | |
| 184 | +where | |
| 185 | + Objects: gix_object::FindObjectOrHeader, | |
| 186 | + VisitFn: for<'delegate> FnMut(ChangeRef<'_>) -> Result<Action, E>, | |
| 187 | + E: Into<Box<dyn std::error::Error + Sync + Send + 'static>>, | |
| 188 | +{ | |
| 189 | + fn pop_front_tracked_path_and_set_current(&mut self) { | |
| 190 | + self.recorder.pop_front_tracked_path_and_set_current(); | |
| 191 | + } | |
| 192 | + | |
| 193 | + fn push_back_tracked_path_component(&mut self, component: &BStr) { | |
| 194 | + self.recorder.push_back_tracked_path_component(component); | |
| 195 | + } | |
| 196 | + | |
| 197 | + fn push_path_component(&mut self, component: &BStr) { | |
| 198 | + self.recorder.push_path_component(component); | |
| 199 | + } | |
| 200 | + | |
| 201 | + fn pop_path_component(&mut self) { | |
| 202 | + self.recorder.pop_path_component(); | |
| 203 | + } | |
| 204 | + | |
| 205 | + fn visit(&mut self, change: crate::tree::visit::Change) -> crate::tree::visit::Action { | |
| 206 | + match self.tracked.as_mut() { | |
| 207 | + Some(tracked) => tracked | |
| 208 | + .try_push_change(change, self.recorder.path()) | |
| 209 | + .map_or(crate::tree::visit::Action::Continue, |change| { | |
| 210 | + Self::emit_change(change, self.recorder.path(), &mut self.visit, &mut self.err) | |
| 211 | + }), | |
| 212 | + None => Self::emit_change(change, self.recorder.path(), &mut self.visit, &mut self.err), | |
| 213 | + } | |
| 214 | + } | |
| 215 | +} | |
| 216 | + | |
| 217 | +mod tree_to_changes { | |
| 218 | + use crate::tree::visit::Change; | |
| 219 | + use gix_object::tree::EntryRef; | |
| 220 | + | |
| 221 | + use bstr::BStr; | |
| 222 | + | |
| 223 | + pub struct Delegate<'a> { | |
| 224 | + push: &'a mut dyn FnMut(Change, &BStr), | |
| 225 | + recorder: gix_traverse::tree::Recorder, | |
| 226 | + } | |
| 227 | + | |
| 228 | + impl<'a> Delegate<'a> { | |
| 229 | + pub fn new(push: &'a mut dyn FnMut(Change, &BStr), location: Option<crate::tree::recorder::Location>) -> Self { | |
| 230 | + let location = location.map(|t| match t { | |
| 231 | + crate::tree::recorder::Location::FileName => gix_traverse::tree::recorder::Location::FileName, | |
| 232 | + crate::tree::recorder::Location::Path => gix_traverse::tree::recorder::Location::Path, | |
| 233 | + }); | |
| 234 | + Self { | |
| 235 | + push, | |
| 236 | + recorder: gix_traverse::tree::Recorder::default().track_location(location), | |
| 237 | + } | |
| 238 | + } | |
| 239 | + } | |
| 240 | + | |
| 241 | + impl gix_traverse::tree::Visit for Delegate<'_> { | |
| 242 | + fn pop_front_tracked_path_and_set_current(&mut self) { | |
| 243 | + self.recorder.pop_front_tracked_path_and_set_current(); | |
| 244 | + } | |
| 245 | + | |
| 246 | + fn push_back_tracked_path_component(&mut self, component: &BStr) { | |
| 247 | + self.recorder.push_back_tracked_path_component(component); | |
| 248 | + } | |
| 249 | + | |
| 250 | + fn push_path_component(&mut self, component: &BStr) { | |
| 251 | + self.recorder.push_path_component(component); | |
| 252 | + } | |
| 253 | + | |
| 254 | + fn pop_path_component(&mut self) { | |
| 255 | + self.recorder.pop_path_component(); | |
| 256 | + } | |
| 257 | + | |
| 258 | + fn visit_tree(&mut self, _entry: &EntryRef<'_>) -> gix_traverse::tree::visit::Action { | |
| 259 | + gix_traverse::tree::visit::Action::Continue | |
| 260 | + } | |
| 261 | + | |
| 262 | + fn visit_nontree(&mut self, entry: &EntryRef<'_>) -> gix_traverse::tree::visit::Action { | |
| 263 | + if entry.mode.is_blob() { | |
| 264 | + (self.push)( | |
| 265 | + Change::Modification { | |
| 266 | + previous_entry_mode: entry.mode, | |
| 267 | + previous_oid: gix_hash::ObjectId::null(entry.oid.kind()), | |
| 268 | + entry_mode: entry.mode, | |
| 269 | + oid: entry.oid.to_owned(), | |
| 270 | + }, | |
| 271 | + self.recorder.path(), | |
| 272 | + ); | |
| 273 | + } | |
| 274 | + gix_traverse::tree::visit::Action::Continue | |
| 275 | + } | |
| 276 | + } | |
| 277 | +} | |
| @@ -0,0 +1,39 @@ | ||
| 1 | +use crate::tree::recorder::Location; | |
| 2 | +use crate::Rewrites; | |
| 3 | + | |
| 4 | +mod change; | |
| 5 | +pub use change::{Change, ChangeRef}; | |
| 6 | + | |
| 7 | +/// The error returned by [`tree_with_rewrites()`](super::tree_with_rewrites()). | |
| 8 | +#[derive(Debug, thiserror::Error)] | |
| 9 | +#[allow(missing_docs)] | |
| 10 | +pub enum Error { | |
| 11 | + #[error(transparent)] | |
| 12 | + Diff(#[from] crate::tree::Error), | |
| 13 | + #[error("The user-provided callback failed")] | |
| 14 | + ForEach(#[source] Box<dyn std::error::Error + Send + Sync + 'static>), | |
| 15 | + #[error("Failure during rename tracking")] | |
| 16 | + RenameTracking(#[from] crate::rewrites::tracker::emit::Error), | |
| 17 | +} | |
| 18 | + | |
| 19 | +/// Returned by the [`tree_with_rewrites()`](super::tree_with_rewrites()) function to control flow. | |
| 20 | +#[derive(Default, Clone, Copy, PartialOrd, PartialEq, Ord, Eq, Hash)] | |
| 21 | +pub enum Action { | |
| 22 | + /// Continue the traversal of changes. | |
| 23 | + #[default] | |
| 24 | + Continue, | |
| 25 | + /// Stop the traversal of changes and stop calling the function that returned it. | |
| 26 | + Cancel, | |
| 27 | +} | |
| 28 | + | |
| 29 | +/// Options for use in [`tree_with_rewrites()`](super::tree_with_rewrites()). | |
| 30 | +#[derive(Default, Clone, Debug)] | |
| 31 | +pub struct Options { | |
| 32 | + /// Determine how locations of changes, i.e. their repository-relative path, should be tracked. | |
| 33 | + /// If `None`, locations will always be empty. | |
| 34 | + pub location: Option<Location>, | |
| 35 | + /// If not `None`, rename tracking will be performed accordingly. | |
| 36 | + pub rewrites: Option<Rewrites>, | |
| 37 | +} | |
| 38 | + | |
| 39 | +pub(super) mod function; | |
| @@ -17,6 +17,7 @@ name = "diff" · 16 unmodified lines | ||
| 17 | 17 | path = "diff/main.rs" |
| 18 | 18 | |
| 19 | 19 | [dev-dependencies] |
| 20 | +insta = "1.40.0" | |
| 20 | 21 | gix-diff = { path = ".." } |
| 21 | 22 | gix-hash = { path = "../../gix-hash" } |
| 22 | 23 | gix-fs = { path = "../../gix-fs" } |
| @@ -7,6 +7,7 @@ fn hex_to_id(hex: &str) -> gix_hash::ObjectId { · 6 unmodified lines | ||
| 7 | 7 | mod blob; |
| 8 | 8 | mod rewrites; |
| 9 | 9 | mod tree; |
| 10 | +mod tree_with_rewrites; | |
| 10 | 11 | |
| 11 | 12 | mod util { |
| 12 | 13 | use std::collections::HashMap; |
| @@ -0,0 +1,1989 @@ | ||
| 1 | +use gix_diff::rewrites::{Copies, CopySource}; | |
| 2 | +use gix_diff::tree::recorder::Location; | |
| 3 | +use gix_diff::tree::visit::Relation; | |
| 4 | +use gix_diff::tree_with_rewrites::{Change, Options}; | |
| 5 | +use gix_diff::Rewrites; | |
| 6 | +use gix_object::bstr::BStr; | |
| 7 | +use gix_object::TreeRefIter; | |
| 8 | + | |
| 9 | +#[test] | |
| 10 | +fn empty_to_new_tree_without_rename_tracking() -> crate::Result { | |
| 11 | + let (changes, _out) = collect_changes(None, "c1 - initial").expect("full path tracking is the default"); | |
| 12 | + insta::assert_debug_snapshot!(changes, @r#" | |
| 13 | + [ | |
| 14 | + Addition { | |
| 15 | + location: "a", | |
| 16 | + relation: None, | |
| 17 | + entry_mode: EntryMode( | |
| 18 | + 33188, | |
| 19 | + ), | |
| 20 | + id: Sha1(e69de29bb2d1d6434b8b29ae775ad8c2e48c5391), | |
| 21 | + }, | |
| 22 | + Addition { | |
| 23 | + location: "b", | |
| 24 | + relation: None, | |
| 25 | + entry_mode: EntryMode( | |
| 26 | + 33188, | |
| 27 | + ), | |
| 28 | + id: Sha1(e69de29bb2d1d6434b8b29ae775ad8c2e48c5391), | |
| 29 | + }, | |
| 30 | + Addition { | |
| 31 | + location: "d", | |
| 32 | + relation: None, | |
| 33 | + entry_mode: EntryMode( | |
| 34 | + 33188, | |
| 35 | + ), | |
| 36 | + id: Sha1(e69de29bb2d1d6434b8b29ae775ad8c2e48c5391), | |
| 37 | + }, | |
| 38 | + Addition { | |
| 39 | + location: "dir", | |
| 40 | + relation: Some( | |
| 41 | + Parent( | |
| 42 | + 1, | |
| 43 | + ), | |
| 44 | + ), | |
| 45 | + entry_mode: EntryMode( | |
| 46 | + 16384, | |
| 47 | + ), | |
| 48 | + id: Sha1(587ff082e0b98914788500eae5dd6a33f04883c9), | |
| 49 | + }, | |
| 50 | + Addition { | |
| 51 | + location: "dir/c", | |
| 52 | + relation: Some( | |
| 53 | + ChildOfParent( | |
| 54 | + 1, | |
| 55 | + ), | |
| 56 | + ), | |
| 57 | + entry_mode: EntryMode( | |
| 58 | + 33188, | |
| 59 | + ), | |
| 60 | + id: Sha1(e69de29bb2d1d6434b8b29ae775ad8c2e48c5391), | |
| 61 | + }, | |
| 62 | + ] | |
| 63 | + "#); | |
| 64 | + | |
| 65 | + let (changes, _out) = collect_changes_opts( | |
| 66 | + None, | |
| 67 | + "c1 - initial", | |
| 68 | + Options { | |
| 69 | + location: Some(Location::FileName), | |
| 70 | + ..Default::default() | |
| 71 | + }, | |
| 72 | + ) | |
| 73 | + .expect("the path-options are respected - we only see the filename here"); | |
| 74 | + insta::assert_debug_snapshot!(changes, @r#" | |
| 75 | + [ | |
| 76 | + Addition { | |
| 77 | + location: "a", | |
| 78 | + relation: None, | |
| 79 | + entry_mode: EntryMode( | |
| 80 | + 33188, | |
| 81 | + ), | |
| 82 | + id: Sha1(e69de29bb2d1d6434b8b29ae775ad8c2e48c5391), | |
| 83 | + }, | |
| 84 | + Addition { | |
| 85 | + location: "b", | |
| 86 | + relation: None, | |
| 87 | + entry_mode: EntryMode( | |
| 88 | + 33188, | |
| 89 | + ), | |
| 90 | + id: Sha1(e69de29bb2d1d6434b8b29ae775ad8c2e48c5391), | |
| 91 | + }, | |
| 92 | + Addition { | |
| 93 | + location: "d", | |
| 94 | + relation: None, | |
| 95 | + entry_mode: EntryMode( | |
| 96 | + 33188, | |
| 97 | + ), | |
| 98 | + id: Sha1(e69de29bb2d1d6434b8b29ae775ad8c2e48c5391), | |
| 99 | + }, | |
| 100 | + Addition { | |
| 101 | + location: "dir", | |
| 102 | + relation: Some( | |
| 103 | + Parent( | |
| 104 | + 1, | |
| 105 | + ), | |
| 106 | + ), | |
| 107 | + entry_mode: EntryMode( | |
| 108 | + 16384, | |
| 109 | + ), | |
| 110 | + id: Sha1(587ff082e0b98914788500eae5dd6a33f04883c9), | |
| 111 | + }, | |
| 112 | + Addition { | |
| 113 | + location: "c", | |
| 114 | + relation: Some( | |
| 115 | + ChildOfParent( | |
| 116 | + 1, | |
| 117 | + ), | |
| 118 | + ), | |
| 119 | + entry_mode: EntryMode( | |
| 120 | + 33188, | |
| 121 | + ), | |
| 122 | + id: Sha1(e69de29bb2d1d6434b8b29ae775ad8c2e48c5391), | |
| 123 | + }, | |
| 124 | + ] | |
| 125 | + "#); | |
| 126 | + | |
| 127 | + { | |
| 128 | + let (lhs, rhs, mut cache, odb) = repo_with_trees(None, "c1 - initial")?; | |
| 129 | + let err = gix_diff::tree_with_rewrites( | |
| 130 | + TreeRefIter::from_bytes(&lhs), | |
| 131 | + TreeRefIter::from_bytes(&rhs), | |
| 132 | + &mut cache, | |
| 133 | + &mut Default::default(), | |
| 134 | + &odb, | |
| 135 | + |_change| Err(std::io::Error::new(std::io::ErrorKind::Other, "custom error")), | |
| 136 | + Options::default(), | |
| 137 | + ) | |
| 138 | + .unwrap_err(); | |
| 139 | + assert_eq!( | |
| 140 | + err.to_string(), | |
| 141 | + "The user-provided callback failed", | |
| 142 | + "custom errors made visible and not squelched" | |
| 143 | + ); | |
| 144 | + } | |
| 145 | + Ok(()) | |
| 146 | +} | |
| 147 | + | |
| 148 | +#[test] | |
| 149 | +fn changes_against_modified_tree_with_filename_tracking() -> crate::Result { | |
| 150 | + let (changes, _out) = collect_changes("c2", "c3-modification")?; | |
| 151 | + | |
| 152 | + insta::assert_debug_snapshot!(changes, @r#" | |
| 153 | + [ | |
| 154 | + Modification { | |
| 155 | + location: "a", | |
| 156 | + previous_entry_mode: EntryMode( | |
| 157 | + 33188, | |
| 158 | + ), | |
| 159 | + previous_id: Sha1(78981922613b2afb6025042ff6bd878ac1994e85), | |
| 160 | + entry_mode: EntryMode( | |
| 161 | + 33188, | |
| 162 | + ), | |
| 163 | + id: Sha1(b4f17b61de71d9b2e54ac9e62b1629ae2d97a6a7), | |
| 164 | + }, | |
| 165 | + Modification { | |
| 166 | + location: "dir", | |
| 167 | + previous_entry_mode: EntryMode( | |
| 168 | + 16384, | |
| 169 | + ), | |
| 170 | + previous_id: Sha1(e5c63aefe4327cb1c780c71966b678ce8e4225da), | |
| 171 | + entry_mode: EntryMode( | |
| 172 | + 16384, | |
| 173 | + ), | |
| 174 | + id: Sha1(c7ac5f82f536976f3561c9999b5f11e5893358be), | |
| 175 | + }, | |
| 176 | + Modification { | |
| 177 | + location: "dir/c", | |
| 178 | + previous_entry_mode: EntryMode( | |
| 179 | + 33188, | |
| 180 | + ), | |
| 181 | + previous_id: Sha1(6695780ceb14b05e076a99bbd2babf34723b3464), | |
| 182 | + entry_mode: EntryMode( | |
| 183 | + 33188, | |
| 184 | + ), | |
| 185 | + id: Sha1(40006fcef15a8853a1b7ae186d93b7d680fd29cf), | |
| 186 | + }, | |
| 187 | + ] | |
| 188 | + "#); | |
| 189 | + let (changes, _out) = collect_changes_opts( | |
| 190 | + "c2", | |
| 191 | + "c3-modification", | |
| 192 | + Options { | |
| 193 | + location: Some(Location::FileName), | |
| 194 | + ..Default::default() | |
| 195 | + }, | |
| 196 | + )?; | |
| 197 | + insta::assert_debug_snapshot!(changes, @r#" | |
| 198 | + [ | |
| 199 | + Modification { | |
| 200 | + location: "a", | |
| 201 | + previous_entry_mode: EntryMode( | |
| 202 | + 33188, | |
| 203 | + ), | |
| 204 | + previous_id: Sha1(78981922613b2afb6025042ff6bd878ac1994e85), | |
| 205 | + entry_mode: EntryMode( | |
| 206 | + 33188, | |
| 207 | + ), | |
| 208 | + id: Sha1(b4f17b61de71d9b2e54ac9e62b1629ae2d97a6a7), | |
| 209 | + }, | |
| 210 | + Modification { | |
| 211 | + location: "dir", | |
| 212 | + previous_entry_mode: EntryMode( | |
| 213 | + 16384, | |
| 214 | + ), | |
| 215 | + previous_id: Sha1(e5c63aefe4327cb1c780c71966b678ce8e4225da), | |
| 216 | + entry_mode: EntryMode( | |
| 217 | + 16384, | |
| 218 | + ), | |
| 219 | + id: Sha1(c7ac5f82f536976f3561c9999b5f11e5893358be), | |
| 220 | + }, | |
| 221 | + Modification { | |
| 222 | + location: "c", | |
| 223 | + previous_entry_mode: EntryMode( | |
| 224 | + 33188, | |
| 225 | + ), | |
| 226 | + previous_id: Sha1(6695780ceb14b05e076a99bbd2babf34723b3464), | |
| 227 | + entry_mode: EntryMode( | |
| 228 | + 33188, | |
| 229 | + ), | |
| 230 | + id: Sha1(40006fcef15a8853a1b7ae186d93b7d680fd29cf), | |
| 231 | + }, | |
| 232 | + ] | |
| 233 | + "#); | |
| 234 | + Ok(()) | |
| 235 | +} | |
| 236 | + | |
| 237 | +#[test] | |
| 238 | +fn renames_by_identity() -> crate::Result { | |
| 239 | + for (from, to, expected, assert_msg) in [ | |
| 240 | + ( | |
| 241 | + "c3-modification", | |
| 242 | + "r1-identity", | |
| 243 | + vec![BStr::new("a"), "dir/a-moved".into()], | |
| 244 | + "one rename and nothing else", | |
| 245 | + ), | |
| 246 | + ( | |
| 247 | + "c4 - add identical files", | |
| 248 | + "r2-ambiguous", | |
| 249 | + vec![ | |
| 250 | + "s1".into(), | |
| 251 | + "b1".into(), | |
| 252 | + "s2".into(), | |
| 253 | + "b2".into(), | |
| 254 | + "s3".into(), | |
| 255 | + "z".into(), | |
| 256 | + ], | |
| 257 | + "multiple possible sources decide by ordering everything lexicographically", | |
| 258 | + ), | |
| 259 | + ( | |
| 260 | + "c5 - add links", | |
| 261 | + "r4-symlinks", | |
| 262 | + vec!["link-1".into(), "renamed-link-1".into()], | |
| 263 | + "symlinks are only tracked by identity", | |
| 264 | + ), | |
| 265 | + ( | |
| 266 | + "r1-identity", | |
| 267 | + "c4 - add identical files", | |
| 268 | + vec![], | |
| 269 | + "not having any renames is OK as well", | |
| 270 | + ), | |
| 271 | + ( | |
| 272 | + "tc1-identity", | |
| 273 | + "tc1-identity", | |
| 274 | + vec![], | |
| 275 | + "copy tracking is off by default", | |
| 276 | + ), | |
| 277 | + ] { | |
| 278 | + for percentage in [None, Some(0.5)] { | |
| 279 | + let (changes, out) = collect_changes_opts( | |
| 280 | + from, | |
| 281 | + to, | |
| 282 | + Options { | |
| 283 | + location: Some(Location::Path), | |
| 284 | + rewrites: Some(Rewrites { | |
| 285 | + percentage, | |
| 286 | + ..Default::default() | |
| 287 | + }), | |
| 288 | + }, | |
| 289 | + )?; | |
| 290 | + let actual: Vec<_> = changes | |
| 291 | + .into_iter() | |
| 292 | + .filter(|c| !c.entry_mode().is_tree()) | |
| 293 | + .flat_map(|c| match c { | |
| 294 | + Change::Rewrite { | |
| 295 | + source_location, | |
| 296 | + location, | |
| 297 | + copy, | |
| 298 | + .. | |
| 299 | + } => { | |
| 300 | + assert!(!copy); | |
| 301 | + vec![source_location, location] | |
| 302 | + } | |
| 303 | + _ => vec![], | |
| 304 | + }) | |
| 305 | + .collect(); | |
| 306 | + | |
| 307 | + assert_eq!(actual, expected, "{assert_msg}"); | |
| 308 | + #[cfg(not(windows))] | |
| 309 | + assert_eq!( | |
| 310 | + out.expect("present as rewrites are configured").num_similarity_checks, | |
| 311 | + 0, | |
| 312 | + "there are no fuzzy checks in if everything was resolved by identity only" | |
| 313 | + ); | |
| 314 | + } | |
| 315 | + } | |
| 316 | + Ok(()) | |
| 317 | +} | |
| 318 | + | |
| 319 | +#[test] | |
| 320 | +fn rename_by_similarity() -> crate::Result { | |
| 321 | + insta::allow_duplicates! { | |
| 322 | + for percentage in [ | |
| 323 | + None, | |
| 324 | + Some(0.76), /*cutoff point where git stops seeing it as equal */ | |
| 325 | + ] { | |
| 326 | + let (changes, out) = collect_changes_opts( | |
| 327 | + "r2-ambiguous", | |
| 328 | + "r3-simple", | |
| 329 | + Options { | |
| 330 | + location: Some(Location::Path), | |
| 331 | + rewrites: Some(Rewrites { | |
| 332 | + percentage, | |
| 333 | + ..Default::default() | |
| 334 | + }), | |
| 335 | + }, | |
| 336 | + ).expect("errors can only happen with IO or ODB access fails"); | |
| 337 | + insta::assert_debug_snapshot!( | |
| 338 | + changes, | |
| 339 | + @r#" | |
| 340 | + [ | |
| 341 | + Modification { | |
| 342 | + location: "b", | |
| 343 | + previous_entry_mode: EntryMode( | |
| 344 | + 33188, | |
| 345 | + ), | |
| 346 | + previous_id: Sha1(61780798228d17af2d34fce4cfbdf35556832472), | |
| 347 | + entry_mode: EntryMode( | |
| 348 | + 33188, | |
| 349 | + ), | |
| 350 | + id: Sha1(54781fa52cf133fa9d0bf59cfe2ef2621b5ad29f), | |
| 351 | + }, | |
| 352 | + Modification { | |
| 353 | + location: "dir", | |
| 354 | + previous_entry_mode: EntryMode( | |
| 355 | + 16384, | |
| 356 | + ), | |
| 357 | + previous_id: Sha1(d1622e275dbb2cb3215a0bdcd2fc77273891f360), | |
| 358 | + entry_mode: EntryMode( | |
| 359 | + 16384, | |
| 360 | + ), | |
| 361 | + id: Sha1(6602e61ea053525e4907e155c0b3da3a269e1385), | |
| 362 | + }, | |
| 363 | + Deletion { | |
| 364 | + location: "dir/c", | |
| 365 | + relation: None, | |
| 366 | + entry_mode: EntryMode( | |
| 367 | + 33188, | |
| 368 | + ), | |
| 369 | + id: Sha1(40006fcef15a8853a1b7ae186d93b7d680fd29cf), | |
| 370 | + }, | |
| 371 | + Addition { | |
| 372 | + location: "dir/c-moved", | |
| 373 | + relation: None, | |
| 374 | + entry_mode: EntryMode( | |
| 375 | + 33188, | |
| 376 | + ), | |
| 377 | + id: Sha1(f01e8ddf5adc56985b9a1cda6d7c7ef9e3abe034), | |
| 378 | + }, | |
| 379 | + ] | |
| 380 | + "# | |
| 381 | + ); | |
| 382 | + let out = out.expect("tracking enabled"); | |
| 383 | + assert_eq!(out.num_similarity_checks, if percentage.is_some() { 1 } else { 0 }); | |
| 384 | + assert_eq!(out.num_similarity_checks_skipped_for_rename_tracking_due_to_limit, 0); | |
| 385 | + assert_eq!(out.num_similarity_checks_skipped_for_copy_tracking_due_to_limit, 0); | |
| 386 | + } | |
| 387 | + } | |
| 388 | + | |
| 389 | + let (changes, out) = collect_changes_opts( | |
| 390 | + "r2-ambiguous", | |
| 391 | + "r3-simple", | |
| 392 | + Options { | |
| 393 | + location: Some(Location::Path), | |
| 394 | + rewrites: Some(Rewrites { | |
| 395 | + percentage: Some(0.6), | |
| 396 | + limit: 1, // has no effect as it's just one item here. | |
| 397 | + ..Default::default() | |
| 398 | + }), | |
| 399 | + }, | |
| 400 | + ) | |
| 401 | + .expect("it found all items at the cut-off point, similar to git"); | |
| 402 | + | |
| 403 | + insta::assert_debug_snapshot!(changes, @r#" | |
| 404 | + [ | |
| 405 | + Modification { | |
| 406 | + location: "b", | |
| 407 | + previous_entry_mode: EntryMode( | |
| 408 | + 33188, | |
| 409 | + ), | |
| 410 | + previous_id: Sha1(61780798228d17af2d34fce4cfbdf35556832472), | |
| 411 | + entry_mode: EntryMode( | |
| 412 | + 33188, | |
| 413 | + ), | |
| 414 | + id: Sha1(54781fa52cf133fa9d0bf59cfe2ef2621b5ad29f), | |
| 415 | + }, | |
| 416 | + Modification { | |
| 417 | + location: "dir", | |
| 418 | + previous_entry_mode: EntryMode( | |
| 419 | + 16384, | |
| 420 | + ), | |
| 421 | + previous_id: Sha1(d1622e275dbb2cb3215a0bdcd2fc77273891f360), | |
| 422 | + entry_mode: EntryMode( | |
| 423 | + 16384, | |
| 424 | + ), | |
| 425 | + id: Sha1(6602e61ea053525e4907e155c0b3da3a269e1385), | |
| 426 | + }, | |
| 427 | + Rewrite { | |
| 428 | + source_location: "dir/c", | |
| 429 | + source_entry_mode: EntryMode( | |
| 430 | + 33188, | |
| 431 | + ), | |
| 432 | + source_relation: None, | |
| 433 | + source_id: Sha1(40006fcef15a8853a1b7ae186d93b7d680fd29cf), | |
| 434 | + diff: Some( | |
| 435 | + DiffLineStats { | |
| 436 | + removals: 0, | |
| 437 | + insertions: 1, | |
| 438 | + before: 2, | |
| 439 | + after: 3, | |
| 440 | + similarity: 0.65, | |
| 441 | + }, | |
| 442 | + ), | |
| 443 | + entry_mode: EntryMode( | |
| 444 | + 33188, | |
| 445 | + ), | |
| 446 | + id: Sha1(f01e8ddf5adc56985b9a1cda6d7c7ef9e3abe034), | |
| 447 | + location: "dir/c-moved", | |
| 448 | + relation: None, | |
| 449 | + copy: false, | |
| 450 | + }, | |
| 451 | + ] | |
| 452 | + "#); | |
| 453 | + | |
| 454 | + let out = out.expect("tracking enabled"); | |
| 455 | + assert_eq!(out.num_similarity_checks, 1); | |
| 456 | + assert_eq!(out.num_similarity_checks_skipped_for_rename_tracking_due_to_limit, 0); | |
| 457 | + assert_eq!(out.num_similarity_checks_skipped_for_copy_tracking_due_to_limit, 0); | |
| 458 | + Ok(()) | |
| 459 | +} | |
| 460 | + | |
| 461 | +#[test] | |
| 462 | +fn renames_by_similarity_with_limit() -> crate::Result { | |
| 463 | + let (changes, out) = collect_changes_opts( | |
| 464 | + "c6", | |
| 465 | + "r5", | |
| 466 | + Options { | |
| 467 | + location: Some(Location::Path), | |
| 468 | + rewrites: Some(Rewrites { | |
| 469 | + limit: 1, // prevent fuzzy tracking from happening | |
| 470 | + ..Default::default() | |
| 471 | + }), | |
| 472 | + }, | |
| 473 | + )?; | |
| 474 | + assert_eq!( | |
| 475 | + changes.iter().filter(|c| matches!(c, Change::Rewrite { .. })).count(), | |
| 476 | + 0, | |
| 477 | + "fuzzy tracking is effectively disabled due to limit" | |
| 478 | + ); | |
| 479 | + let actual: Vec<_> = changes.iter().map(Change::location).collect(); | |
| 480 | + assert_eq!(actual, ["f1", "f1-renamed", "f2", "f2-renamed"],); | |
| 481 | + | |
| 482 | + let out = out.expect("tracking enabled"); | |
| 483 | + assert_eq!(out.num_similarity_checks, 0); | |
| 484 | + assert_eq!(out.num_similarity_checks_skipped_for_rename_tracking_due_to_limit, 4); | |
| 485 | + assert_eq!(out.num_similarity_checks_skipped_for_copy_tracking_due_to_limit, 0); | |
| 486 | + | |
| 487 | + Ok(()) | |
| 488 | +} | |
| 489 | + | |
| 490 | +#[test] | |
| 491 | +fn copies_by_identity() -> crate::Result { | |
| 492 | + let (changes, out) = collect_changes_opts( | |
| 493 | + "c7", | |
| 494 | + "tc1-identity", | |
| 495 | + Options { | |
| 496 | + location: Some(Location::Path), | |
| 497 | + rewrites: Some(Rewrites { | |
| 498 | + copies: Some(Copies { | |
| 499 | + source: CopySource::FromSetOfModifiedFiles, | |
| 500 | + percentage: None, | |
| 501 | + }), | |
| 502 | + limit: 1, // the limit isn't actually used for identity based checks | |
| 503 | + ..Default::default() | |
| 504 | + }), | |
| 505 | + }, | |
| 506 | + )?; | |
| 507 | + insta::assert_debug_snapshot!(changes, @r#" | |
| 508 | + [ | |
| 509 | + Modification { | |
| 510 | + location: "dir", | |
| 511 | + previous_entry_mode: EntryMode( | |
| 512 | + 16384, | |
| 513 | + ), | |
| 514 | + previous_id: Sha1(6602e61ea053525e4907e155c0b3da3a269e1385), | |
| 515 | + entry_mode: EntryMode( | |
| 516 | + 16384, | |
| 517 | + ), | |
| 518 | + id: Sha1(f01fd5b4d733a4ae749cbb58a828cdb3f342f298), | |
| 519 | + }, | |
| 520 | + Rewrite { | |
| 521 | + source_location: "base", | |
| 522 | + source_entry_mode: EntryMode( | |
| 523 | + 33188, | |
| 524 | + ), | |
| 525 | + source_relation: None, | |
| 526 | + source_id: Sha1(f00c965d8307308469e537302baa73048488f162), | |
| 527 | + diff: None, | |
| 528 | + entry_mode: EntryMode( | |
| 529 | + 33188, | |
| 530 | + ), | |
| 531 | + id: Sha1(f00c965d8307308469e537302baa73048488f162), | |
| 532 | + location: "c1", | |
| 533 | + relation: None, | |
| 534 | + copy: true, | |
| 535 | + }, | |
| 536 | + Rewrite { | |
| 537 | + source_location: "base", | |
| 538 | + source_entry_mode: EntryMode( | |
| 539 | + 33188, | |
| 540 | + ), | |
| 541 | + source_relation: None, | |
| 542 | + source_id: Sha1(f00c965d8307308469e537302baa73048488f162), | |
| 543 | + diff: None, | |
| 544 | + entry_mode: EntryMode( | |
| 545 | + 33188, | |
| 546 | + ), | |
| 547 | + id: Sha1(f00c965d8307308469e537302baa73048488f162), | |
| 548 | + location: "c2", | |
| 549 | + relation: None, | |
| 550 | + copy: true, | |
| 551 | + }, | |
| 552 | + Rewrite { | |
| 553 | + source_location: "base", | |
| 554 | + source_entry_mode: EntryMode( | |
| 555 | + 33188, | |
| 556 | + ), | |
| 557 | + source_relation: None, | |
| 558 | + source_id: Sha1(f00c965d8307308469e537302baa73048488f162), | |
| 559 | + diff: None, | |
| 560 | + entry_mode: EntryMode( | |
| 561 | + 33188, | |
| 562 | + ), | |
| 563 | + id: Sha1(f00c965d8307308469e537302baa73048488f162), | |
| 564 | + location: "dir/c3", | |
| 565 | + relation: None, | |
| 566 | + copy: true, | |
| 567 | + }, | |
| 568 | + ] | |
| 569 | + "#); | |
| 570 | + let out = out.expect("tracking enabled"); | |
| 571 | + assert_eq!(out.num_similarity_checks, 0); | |
| 572 | + assert_eq!(out.num_similarity_checks_skipped_for_rename_tracking_due_to_limit, 0); | |
| 573 | + assert_eq!(out.num_similarity_checks_skipped_for_copy_tracking_due_to_limit, 0); | |
| 574 | + | |
| 575 | + Ok(()) | |
| 576 | +} | |
| 577 | + | |
| 578 | +#[test] | |
| 579 | +fn copies_by_similarity() -> crate::Result { | |
| 580 | + let (changes, out) = collect_changes_opts( | |
| 581 | + "tc1-identity", | |
| 582 | + "tc2-similarity", | |
| 583 | + Options { | |
| 584 | + location: Some(Location::Path), | |
| 585 | + rewrites: Some(Rewrites { | |
| 586 | + copies: Some(Copies::default()), | |
| 587 | + ..Default::default() | |
| 588 | + }), | |
| 589 | + }, | |
| 590 | + )?; | |
| 591 | + insta::assert_debug_snapshot!(changes, @r#" | |
| 592 | + [ | |
| 593 | + Modification { | |
| 594 | + location: "dir", | |
| 595 | + previous_entry_mode: EntryMode( | |
| 596 | + 16384, | |
| 597 | + ), | |
| 598 | + previous_id: Sha1(f01fd5b4d733a4ae749cbb58a828cdb3f342f298), | |
| 599 | + entry_mode: EntryMode( | |
| 600 | + 16384, | |
| 601 | + ), | |
| 602 | + id: Sha1(1d7e20e07562a54af0408fd2669b0c56a6faa6f0), | |
| 603 | + }, | |
| 604 | + Rewrite { | |
| 605 | + source_location: "base", | |
| 606 | + source_entry_mode: EntryMode( | |
| 607 | + 33188, | |
| 608 | + ), | |
| 609 | + source_relation: None, | |
| 610 | + source_id: Sha1(3bb459b831ea471b9cd1cbb7c6d54a74251a711b), | |
| 611 | + diff: None, | |
| 612 | + entry_mode: EntryMode( | |
| 613 | + 33188, | |
| 614 | + ), | |
| 615 | + id: Sha1(3bb459b831ea471b9cd1cbb7c6d54a74251a711b), | |
| 616 | + location: "c4", | |
| 617 | + relation: None, | |
| 618 | + copy: true, | |
| 619 | + }, | |
| 620 | + Rewrite { | |
| 621 | + source_location: "base", | |
| 622 | + source_entry_mode: EntryMode( | |
| 623 | + 33188, | |
| 624 | + ), | |
| 625 | + source_relation: None, | |
| 626 | + source_id: Sha1(3bb459b831ea471b9cd1cbb7c6d54a74251a711b), | |
| 627 | + diff: Some( | |
| 628 | + DiffLineStats { | |
| 629 | + removals: 0, | |
| 630 | + insertions: 1, | |
| 631 | + before: 11, | |
| 632 | + after: 12, | |
| 633 | + similarity: 0.8888889, | |
| 634 | + }, | |
| 635 | + ), | |
| 636 | + entry_mode: EntryMode( | |
| 637 | + 33188, | |
| 638 | + ), | |
| 639 | + id: Sha1(08fe19ca4d2f79624f35333157d610811efc1aed), | |
| 640 | + location: "c5", | |
| 641 | + relation: None, | |
| 642 | + copy: true, | |
| 643 | + }, | |
| 644 | + Rewrite { | |
| 645 | + source_location: "base", | |
| 646 | + source_entry_mode: EntryMode( | |
| 647 | + 33188, | |
| 648 | + ), | |
| 649 | + source_relation: None, | |
| 650 | + source_id: Sha1(3bb459b831ea471b9cd1cbb7c6d54a74251a711b), | |
| 651 | + diff: Some( | |
| 652 | + DiffLineStats { | |
| 653 | + removals: 0, | |
| 654 | + insertions: 1, | |
| 655 | + before: 11, | |
| 656 | + after: 12, | |
| 657 | + similarity: 0.8888889, | |
| 658 | + }, | |
| 659 | + ), | |
| 660 | + entry_mode: EntryMode( | |
| 661 | + 33188, | |
| 662 | + ), | |
| 663 | + id: Sha1(cf7a729ca69bfabd0995fc9b083e86a18215bd91), | |
| 664 | + location: "dir/c6", | |
| 665 | + relation: None, | |
| 666 | + copy: true, | |
| 667 | + }, | |
| 668 | + ] | |
| 669 | + "#); | |
| 670 | + | |
| 671 | + let out = out.expect("tracking enabled"); | |
| 672 | + assert_eq!( | |
| 673 | + out.num_similarity_checks, 2, | |
| 674 | + "two are similar, the other one is identical" | |
| 675 | + ); | |
| 676 | + assert_eq!(out.num_similarity_checks_skipped_for_rename_tracking_due_to_limit, 0); | |
| 677 | + assert_eq!(out.num_similarity_checks_skipped_for_copy_tracking_due_to_limit, 0); | |
| 678 | + | |
| 679 | + Ok(()) | |
| 680 | +} | |
| 681 | + | |
| 682 | +#[test] | |
| 683 | +fn copies_in_entire_tree_by_similarity() -> crate::Result { | |
| 684 | + let (changes, out) = collect_changes_opts( | |
| 685 | + "tc2-similarity", | |
| 686 | + "tc3-find-harder", | |
| 687 | + Options { | |
| 688 | + location: Some(Location::Path), | |
| 689 | + rewrites: Some(Rewrites { | |
| 690 | + copies: Some(Copies::default()), | |
| 691 | + ..Default::default() | |
| 692 | + }), | |
| 693 | + }, | |
| 694 | + )?; | |
| 695 | + assert_eq!( | |
| 696 | + changes.iter().filter(|c| matches!(c, Change::Rewrite { .. })).count(), | |
| 697 | + 0, | |
| 698 | + "needs --find-copies-harder to detect rewrites here" | |
| 699 | + ); | |
| 700 | + let actual: Vec<_> = changes.iter().map(Change::location).collect(); | |
| 701 | + assert_eq!(actual, ["b", "c6", "c7", "newly-added"]); | |
| 702 | + | |
| 703 | + let out = out.expect("tracking enabled"); | |
| 704 | + assert_eq!( | |
| 705 | + out.num_similarity_checks, 3, | |
| 706 | + "it does have some candidates, probably for rename tracking" | |
| 707 | + ); | |
| 708 | + assert_eq!( | |
| 709 | + out.num_similarity_checks_skipped_for_rename_tracking_due_to_limit, 0, | |
| 710 | + "no limit configured" | |
| 711 | + ); | |
| 712 | + assert_eq!(out.num_similarity_checks_skipped_for_copy_tracking_due_to_limit, 0); | |
| 713 | + | |
| 714 | + let (changes, out) = collect_changes_opts( | |
| 715 | + "tc2-similarity", | |
| 716 | + "tc3-find-harder", | |
| 717 | + Options { | |
| 718 | + location: Some(Location::Path), | |
| 719 | + rewrites: Some(Rewrites { | |
| 720 | + copies: Some(Copies { | |
| 721 | + source: CopySource::FromSetOfModifiedFilesAndAllSources, | |
| 722 | + ..Default::default() | |
| 723 | + }), | |
| 724 | + ..Default::default() | |
| 725 | + }), | |
| 726 | + }, | |
| 727 | + )?; | |
| 728 | + insta::assert_debug_snapshot!(changes, @r#" | |
| 729 | + [ | |
| 730 | + Rewrite { | |
| 731 | + source_location: "base", | |
| 732 | + source_entry_mode: EntryMode( | |
| 733 | + 33188, | |
| 734 | + ), | |
| 735 | + source_relation: None, | |
| 736 | + source_id: Sha1(3bb459b831ea471b9cd1cbb7c6d54a74251a711b), | |
| 737 | + diff: None, | |
| 738 | + entry_mode: EntryMode( | |
| 739 | + 33188, | |
| 740 | + ), | |
| 741 | + id: Sha1(3bb459b831ea471b9cd1cbb7c6d54a74251a711b), | |
| 742 | + location: "c6", | |
| 743 | + relation: None, | |
| 744 | + copy: true, | |
| 745 | + }, | |
| 746 | + Rewrite { | |
| 747 | + source_location: "dir/c6", | |
| 748 | + source_entry_mode: EntryMode( | |
| 749 | + 33188, | |
| 750 | + ), | |
| 751 | + source_relation: None, | |
| 752 | + source_id: Sha1(cf7a729ca69bfabd0995fc9b083e86a18215bd91), | |
| 753 | + diff: None, | |
| 754 | + entry_mode: EntryMode( | |
| 755 | + 33188, | |
| 756 | + ), | |
| 757 | + id: Sha1(cf7a729ca69bfabd0995fc9b083e86a18215bd91), | |
| 758 | + location: "c7", | |
| 759 | + relation: None, | |
| 760 | + copy: true, | |
| 761 | + }, | |
| 762 | + Rewrite { | |
| 763 | + source_location: "c5", | |
| 764 | + source_entry_mode: EntryMode( | |
| 765 | + 33188, | |
| 766 | + ), | |
| 767 | + source_relation: None, | |
| 768 | + source_id: Sha1(08fe19ca4d2f79624f35333157d610811efc1aed), | |
| 769 | + diff: Some( | |
| 770 | + DiffLineStats { | |
| 771 | + removals: 0, | |
| 772 | + insertions: 3, | |
| 773 | + before: 12, | |
| 774 | + after: 15, | |
| 775 | + similarity: 0.75, | |
| 776 | + }, | |
| 777 | + ), | |
| 778 | + entry_mode: EntryMode( | |
| 779 | + 33188, | |
| 780 | + ), | |
| 781 | + id: Sha1(97b3d1a5707f8a11fa5fa8bc6c3bd7b3965601fd), | |
| 782 | + location: "newly-added", | |
| 783 | + relation: None, | |
| 784 | + copy: true, | |
| 785 | + }, | |
| 786 | + Modification { | |
| 787 | + location: "b", | |
| 788 | + previous_entry_mode: EntryMode( | |
| 789 | + 33188, | |
| 790 | + ), | |
| 791 | + previous_id: Sha1(54781fa52cf133fa9d0bf59cfe2ef2621b5ad29f), | |
| 792 | + entry_mode: EntryMode( | |
| 793 | + 33188, | |
| 794 | + ), | |
| 795 | + id: Sha1(f198d0640214092732566fb00543163845c8252c), | |
| 796 | + }, | |
| 797 | + ] | |
| 798 | + "#); | |
| 799 | + let out = out.expect("tracking enabled"); | |
| 800 | + assert_eq!(out.num_similarity_checks, 4); | |
| 801 | + assert_eq!( | |
| 802 | + out.num_similarity_checks_skipped_for_rename_tracking_due_to_limit, 0, | |
| 803 | + "no limit configured" | |
| 804 | + ); | |
| 805 | + assert_eq!(out.num_similarity_checks_skipped_for_copy_tracking_due_to_limit, 0); | |
| 806 | + | |
| 807 | + Ok(()) | |
| 808 | +} | |
| 809 | + | |
| 810 | +#[test] | |
| 811 | +fn copies_in_entire_tree_by_similarity_with_limit() -> crate::Result { | |
| 812 | + let (changes, out) = collect_changes_opts( | |
| 813 | + "tc2-similarity", | |
| 814 | + "tc3-find-harder", | |
| 815 | + Options { | |
| 816 | + location: Some(Location::Path), | |
| 817 | + rewrites: Some(Rewrites { | |
| 818 | + copies: Some(Copies { | |
| 819 | + source: CopySource::FromSetOfModifiedFilesAndAllSources, | |
| 820 | + ..Default::default() | |
| 821 | + }), | |
| 822 | + limit: 2, // similarity checks can't be made that way | |
| 823 | + ..Default::default() | |
| 824 | + }), | |
| 825 | + }, | |
| 826 | + )?; | |
| 827 | + insta::assert_debug_snapshot!(changes, @r#" | |
| 828 | + [ | |
| 829 | + Rewrite { | |
| 830 | + source_location: "base", | |
| 831 | + source_entry_mode: EntryMode( | |
| 832 | + 33188, | |
| 833 | + ), | |
| 834 | + source_relation: None, | |
| 835 | + source_id: Sha1(3bb459b831ea471b9cd1cbb7c6d54a74251a711b), | |
| 836 | + diff: None, | |
| 837 | + entry_mode: EntryMode( | |
| 838 | + 33188, | |
| 839 | + ), | |
| 840 | + id: Sha1(3bb459b831ea471b9cd1cbb7c6d54a74251a711b), | |
| 841 | + location: "c6", | |
| 842 | + relation: None, | |
| 843 | + copy: true, | |
| 844 | + }, | |
| 845 | + Rewrite { | |
| 846 | + source_location: "dir/c6", | |
| 847 | + source_entry_mode: EntryMode( | |
| 848 | + 33188, | |
| 849 | + ), | |
| 850 | + source_relation: None, | |
| 851 | + source_id: Sha1(cf7a729ca69bfabd0995fc9b083e86a18215bd91), | |
| 852 | + diff: None, | |
| 853 | + entry_mode: EntryMode( | |
| 854 | + 33188, | |
| 855 | + ), | |
| 856 | + id: Sha1(cf7a729ca69bfabd0995fc9b083e86a18215bd91), | |
| 857 | + location: "c7", | |
| 858 | + relation: None, | |
| 859 | + copy: true, | |
| 860 | + }, | |
| 861 | + Modification { | |
| 862 | + location: "b", | |
| 863 | + previous_entry_mode: EntryMode( | |
| 864 | + 33188, | |
| 865 | + ), | |
| 866 | + previous_id: Sha1(54781fa52cf133fa9d0bf59cfe2ef2621b5ad29f), | |
| 867 | + entry_mode: EntryMode( | |
| 868 | + 33188, | |
| 869 | + ), | |
| 870 | + id: Sha1(f198d0640214092732566fb00543163845c8252c), | |
| 871 | + }, | |
| 872 | + Addition { | |
| 873 | + location: "newly-added", | |
| 874 | + relation: None, | |
| 875 | + entry_mode: EntryMode( | |
| 876 | + 33188, | |
| 877 | + ), | |
| 878 | + id: Sha1(97b3d1a5707f8a11fa5fa8bc6c3bd7b3965601fd), | |
| 879 | + }, | |
| 880 | + ] | |
| 881 | + "#); | |
| 882 | + | |
| 883 | + let out = out.expect("tracking enabled"); | |
| 884 | + assert_eq!(out.num_similarity_checks, 0, "similarity checks can't run"); | |
| 885 | + assert_eq!( | |
| 886 | + out.num_similarity_checks_skipped_for_rename_tracking_due_to_limit, 0, | |
| 887 | + "no limit configured" | |
| 888 | + ); | |
| 889 | + assert_eq!(out.num_similarity_checks_skipped_for_copy_tracking_due_to_limit, 19); | |
| 890 | + | |
| 891 | + Ok(()) | |
| 892 | +} | |
| 893 | + | |
| 894 | +#[test] | |
| 895 | +fn copies_by_similarity_with_limit() -> crate::Result { | |
| 896 | + let (changes, out) = collect_changes_opts( | |
| 897 | + "tc1-identity", | |
| 898 | + "tc2-similarity", | |
| 899 | + Options { | |
| 900 | + location: Some(Location::Path), | |
| 901 | + rewrites: Some(Rewrites { | |
| 902 | + copies: Some(Copies::default()), | |
| 903 | + limit: 1, | |
| 904 | + ..Default::default() | |
| 905 | + }), | |
| 906 | + }, | |
| 907 | + )?; | |
| 908 | + | |
| 909 | + insta::assert_debug_snapshot!(changes, @r#" | |
| 910 | + [ | |
| 911 | + Modification { | |
| 912 | + location: "dir", | |
| 913 | + previous_entry_mode: EntryMode( | |
| 914 | + 16384, | |
| 915 | + ), | |
| 916 | + previous_id: Sha1(f01fd5b4d733a4ae749cbb58a828cdb3f342f298), | |
| 917 | + entry_mode: EntryMode( | |
| 918 | + 16384, | |
| 919 | + ), | |
| 920 | + id: Sha1(1d7e20e07562a54af0408fd2669b0c56a6faa6f0), | |
| 921 | + }, | |
| 922 | + Rewrite { | |
| 923 | + source_location: "base", | |
| 924 | + source_entry_mode: EntryMode( | |
| 925 | + 33188, | |
| 926 | + ), | |
| 927 | + source_relation: None, | |
| 928 | + source_id: Sha1(3bb459b831ea471b9cd1cbb7c6d54a74251a711b), | |
| 929 | + diff: None, | |
| 930 | + entry_mode: EntryMode( | |
| 931 | + 33188, | |
| 932 | + ), | |
| 933 | + id: Sha1(3bb459b831ea471b9cd1cbb7c6d54a74251a711b), | |
| 934 | + location: "c4", | |
| 935 | + relation: None, | |
| 936 | + copy: true, | |
| 937 | + }, | |
| 938 | + Addition { | |
| 939 | + location: "c5", | |
| 940 | + relation: None, | |
| 941 | + entry_mode: EntryMode( | |
| 942 | + 33188, | |
| 943 | + ), | |
| 944 | + id: Sha1(08fe19ca4d2f79624f35333157d610811efc1aed), | |
| 945 | + }, | |
| 946 | + Addition { | |
| 947 | + location: "dir/c6", | |
| 948 | + relation: None, | |
| 949 | + entry_mode: EntryMode( | |
| 950 | + 33188, | |
| 951 | + ), | |
| 952 | + id: Sha1(cf7a729ca69bfabd0995fc9b083e86a18215bd91), | |
| 953 | + }, | |
| 954 | + ] | |
| 955 | + "#); | |
| 956 | + | |
| 957 | + let out = out.expect("tracking enabled"); | |
| 958 | + assert_eq!(out.num_similarity_checks, 0); | |
| 959 | + assert_eq!(out.num_similarity_checks_skipped_for_rename_tracking_due_to_limit, 0); | |
| 960 | + assert_eq!( | |
| 961 | + out.num_similarity_checks_skipped_for_copy_tracking_due_to_limit, 2, | |
| 962 | + "limit prevents any similarity check from being performed, and identity fails in most places" | |
| 963 | + ); | |
| 964 | + | |
| 965 | + Ok(()) | |
| 966 | +} | |
| 967 | + | |
| 968 | +#[test] | |
| 969 | +fn realistic_renames_by_identity() -> crate::Result { | |
| 970 | + let (changes, out) = collect_changes_opts( | |
| 971 | + "r1-base", | |
| 972 | + "r1-change", | |
| 973 | + Options { | |
| 974 | + location: Some(Location::Path), | |
| 975 | + rewrites: Some(Rewrites { | |
| 976 | + copies: Some(Copies::default()), | |
| 977 | + limit: 1, | |
| 978 | + ..Default::default() | |
| 979 | + }), | |
| 980 | + }, | |
| 981 | + )?; | |
| 982 | + | |
| 983 | + insta::assert_debug_snapshot!(changes.into_iter().filter(|c| !c.entry_mode().is_tree()).collect::<Vec<_>>(), @r#" | |
| 984 | + [ | |
| 985 | + Rewrite { | |
| 986 | + source_location: "git-index/src/file.rs", | |
| 987 | + source_entry_mode: EntryMode( | |
| 988 | + 33188, | |
| 989 | + ), | |
| 990 | + source_relation: None, | |
| 991 | + source_id: Sha1(e69de29bb2d1d6434b8b29ae775ad8c2e48c5391), | |
| 992 | + diff: None, | |
| 993 | + entry_mode: EntryMode( | |
| 994 | + 33188, | |
| 995 | + ), | |
| 996 | + id: Sha1(e69de29bb2d1d6434b8b29ae775ad8c2e48c5391), | |
| 997 | + location: "git-index/src/file/mod.rs", | |
| 998 | + relation: None, | |
| 999 | + copy: false, | |
| 1000 | + }, | |
| 1001 | + Addition { | |
| 1002 | + location: "git-index/tests/index/file/access.rs", | |
| 1003 | + relation: None, | |
| 1004 | + entry_mode: EntryMode( | |
| 1005 | + 33188, | |
| 1006 | + ), | |
| 1007 | + id: Sha1(e69de29bb2d1d6434b8b29ae775ad8c2e48c5391), | |
| 1008 | + }, | |
| 1009 | + Modification { | |
| 1010 | + location: "git-index/tests/index/file/mod.rs", | |
| 1011 | + previous_entry_mode: EntryMode( | |
| 1012 | + 33188, | |
| 1013 | + ), | |
| 1014 | + previous_id: Sha1(e69de29bb2d1d6434b8b29ae775ad8c2e48c5391), | |
| 1015 | + entry_mode: EntryMode( | |
| 1016 | + 33188, | |
| 1017 | + ), | |
| 1018 | + id: Sha1(8ba3a16384aacc37d01564b28401755ce8053f51), | |
| 1019 | + }, | |
| 1020 | + ] | |
| 1021 | + "#); | |
| 1022 | + | |
| 1023 | + #[cfg(not(windows))] | |
| 1024 | + { | |
| 1025 | + let actual = std::fs::read_to_string(repo_workdir()?.join("baseline.with-renames"))?; | |
| 1026 | + let expected = r#"commit 0231f5093bd3d760e7ee82984e0453da80e05c87 | |
| 1027 | +Author: author <author@example.com> | |
| 1028 | +Date: Sat Jan 1 00:00:00 2000 +0000 | |
| 1029 | + | |
| 1030 | + r1-change | |
| 1031 | + | |
| 1032 | +diff --git a/git-index/src/file.rs b/git-index/src/file/mod.rs | |
| 1033 | +similarity index 100% | |
| 1034 | +rename from git-index/src/file.rs | |
| 1035 | +rename to git-index/src/file/mod.rs | |
| 1036 | +diff --git a/git-index/tests/index/file/access.rs b/git-index/tests/index/file/access.rs | |
| 1037 | +new file mode 100644 | |
| 1038 | +index 0000000..e69de29 | |
| 1039 | +diff --git a/git-index/tests/index/file/mod.rs b/git-index/tests/index/file/mod.rs | |
| 1040 | +index e69de29..8ba3a16 100644 | |
| 1041 | +--- a/git-index/tests/index/file/mod.rs | |
| 1042 | ++++ b/git-index/tests/index/file/mod.rs | |
| 1043 | +@@ -0,0 +1 @@ | |
| 1044 | ++n | |
| 1045 | +"#; | |
| 1046 | + assert_eq!(actual, expected); | |
| 1047 | + } | |
| 1048 | + | |
| 1049 | + let out = out.expect("tracking enabled"); | |
| 1050 | + assert_eq!(out.num_similarity_checks, 1); | |
| 1051 | + assert_eq!(out.num_similarity_checks_skipped_for_rename_tracking_due_to_limit, 0); | |
| 1052 | + assert_eq!(out.num_similarity_checks_skipped_for_copy_tracking_due_to_limit, 0); | |
| 1053 | + | |
| 1054 | + Ok(()) | |
| 1055 | +} | |
| 1056 | + | |
| 1057 | +#[test] | |
| 1058 | +fn realistic_renames_disabled() -> crate::Result { | |
| 1059 | + let (changes, out) = collect_changes_opts( | |
| 1060 | + "r1-base", | |
| 1061 | + "r1-change", | |
| 1062 | + Options { | |
| 1063 | + location: Some(Location::Path), | |
| 1064 | + rewrites: None, | |
| 1065 | + }, | |
| 1066 | + )?; | |
| 1067 | + | |
| 1068 | + insta::assert_debug_snapshot!(changes.into_iter().filter(|c| !c.entry_mode().is_tree()).collect::<Vec<_>>(), @r#" | |
| 1069 | + [ | |
| 1070 | + Deletion { | |
| 1071 | + location: "git-index/src/file.rs", | |
| 1072 | + relation: None, | |
| 1073 | + entry_mode: EntryMode( | |
| 1074 | + 33188, | |
| 1075 | + ), | |
| 1076 | + id: Sha1(e69de29bb2d1d6434b8b29ae775ad8c2e48c5391), | |
| 1077 | + }, | |
| 1078 | + Addition { | |
| 1079 | + location: "git-index/src/file/mod.rs", | |
| 1080 | + relation: None, | |
| 1081 | + entry_mode: EntryMode( | |
| 1082 | + 33188, | |
| 1083 | + ), | |
| 1084 | + id: Sha1(e69de29bb2d1d6434b8b29ae775ad8c2e48c5391), | |
| 1085 | + }, | |
| 1086 | + Addition { | |
| 1087 | + location: "git-index/tests/index/file/access.rs", | |
| 1088 | + relation: None, | |
| 1089 | + entry_mode: EntryMode( | |
| 1090 | + 33188, | |
| 1091 | + ), | |
| 1092 | + id: Sha1(e69de29bb2d1d6434b8b29ae775ad8c2e48c5391), | |
| 1093 | + }, | |
| 1094 | + Modification { | |
| 1095 | + location: "git-index/tests/index/file/mod.rs", | |
| 1096 | + previous_entry_mode: EntryMode( | |
| 1097 | + 33188, | |
| 1098 | + ), | |
| 1099 | + previous_id: Sha1(e69de29bb2d1d6434b8b29ae775ad8c2e48c5391), | |
| 1100 | + entry_mode: EntryMode( | |
| 1101 | + 33188, | |
| 1102 | + ), | |
| 1103 | + id: Sha1(8ba3a16384aacc37d01564b28401755ce8053f51), | |
| 1104 | + }, | |
| 1105 | + ] | |
| 1106 | + "#); | |
| 1107 | + | |
| 1108 | + #[cfg(not(windows))] | |
| 1109 | + { | |
| 1110 | + let actual = std::fs::read_to_string(repo_workdir()?.join("baseline.no-renames"))?; | |
| 1111 | + let expected = r#"commit 0231f5093bd3d760e7ee82984e0453da80e05c87 | |
| 1112 | +Author: author <author@example.com> | |
| 1113 | +Date: Sat Jan 1 00:00:00 2000 +0000 | |
| 1114 | + | |
| 1115 | + r1-change | |
| 1116 | + | |
| 1117 | +diff --git a/git-index/src/file.rs b/git-index/src/file.rs | |
| 1118 | +deleted file mode 100644 | |
| 1119 | +index e69de29..0000000 | |
| 1120 | +diff --git a/git-index/src/file/mod.rs b/git-index/src/file/mod.rs | |
| 1121 | +new file mode 100644 | |
| 1122 | +index 0000000..e69de29 | |
| 1123 | +diff --git a/git-index/tests/index/file/access.rs b/git-index/tests/index/file/access.rs | |
| 1124 | +new file mode 100644 | |
| 1125 | +index 0000000..e69de29 | |
| 1126 | +diff --git a/git-index/tests/index/file/mod.rs b/git-index/tests/index/file/mod.rs | |
| 1127 | +index e69de29..8ba3a16 100644 | |
| 1128 | +--- a/git-index/tests/index/file/mod.rs | |
| 1129 | ++++ b/git-index/tests/index/file/mod.rs | |
| 1130 | +@@ -0,0 +1 @@ | |
| 1131 | ++n | |
| 1132 | +"#; | |
| 1133 | + assert_eq!(actual, expected); | |
| 1134 | + } | |
| 1135 | + | |
| 1136 | + assert_eq!(out, None, "tracking is disabled completely"); | |
| 1137 | + Ok(()) | |
| 1138 | +} | |
| 1139 | + | |
| 1140 | +#[test] | |
| 1141 | +fn realistic_renames_disabled_2() -> crate::Result { | |
| 1142 | + let (changes, out) = collect_changes_opts( | |
| 1143 | + "r2-base", | |
| 1144 | + "r2-change", | |
| 1145 | + Options { | |
| 1146 | + location: Some(Location::Path), | |
| 1147 | + rewrites: None, | |
| 1148 | + }, | |
| 1149 | + )?; | |
| 1150 | + | |
| 1151 | + // Directories are associated with their children, making a bundling possible. | |
| 1152 | + insta::assert_debug_snapshot!(changes.into_iter() | |
| 1153 | + .filter(|c| !c.entry_mode().is_tree() || | |
| 1154 | + c.relation().map_or(false, |r| matches!(r, Relation::Parent(_))) | |
| 1155 | + ).collect::<Vec<_>>(), @r#" | |
| 1156 | + [ | |
| 1157 | + Deletion { | |
| 1158 | + location: "git-sec", | |
| 1159 | + relation: Some( | |
| 1160 | + Parent( | |
| 1161 | + 1, | |
| 1162 | + ), | |
| 1163 | + ), | |
| 1164 | + entry_mode: EntryMode( | |
| 1165 | + 16384, | |
| 1166 | + ), | |
| 1167 | + id: Sha1(0026010e87631065a2739f627622feb14f903fd4), | |
| 1168 | + }, | |
| 1169 | + Addition { | |
| 1170 | + location: "gix-sec", | |
| 1171 | + relation: Some( | |
| 1172 | + Parent( | |
| 1173 | + 2, | |
| 1174 | + ), | |
| 1175 | + ), | |
| 1176 | + entry_mode: EntryMode( | |
| 1177 | + 16384, | |
| 1178 | + ), | |
| 1179 | + id: Sha1(0026010e87631065a2739f627622feb14f903fd4), | |
| 1180 | + }, | |
| 1181 | + Deletion { | |
| 1182 | + location: "git-sec/CHANGELOG.md", | |
| 1183 | + relation: Some( | |
| 1184 | + ChildOfParent( | |
| 1185 | + 1, | |
| 1186 | + ), | |
| 1187 | + ), | |
| 1188 | + entry_mode: EntryMode( | |
| 1189 | + 33188, | |
| 1190 | + ), | |
| 1191 | + id: Sha1(e69de29bb2d1d6434b8b29ae775ad8c2e48c5391), | |
| 1192 | + }, | |
| 1193 | + Deletion { | |
| 1194 | + location: "git-sec/Cargo.toml", | |
| 1195 | + relation: Some( | |
| 1196 | + ChildOfParent( | |
| 1197 | + 1, | |
| 1198 | + ), | |
| 1199 | + ), | |
| 1200 | + entry_mode: EntryMode( | |
| 1201 | + 33188, | |
| 1202 | + ), | |
| 1203 | + id: Sha1(e69de29bb2d1d6434b8b29ae775ad8c2e48c5391), | |
| 1204 | + }, | |
| 1205 | + Addition { | |
| 1206 | + location: "gix-sec/CHANGELOG.md", | |
| 1207 | + relation: Some( | |
| 1208 | + ChildOfParent( | |
| 1209 | + 2, | |
| 1210 | + ), | |
| 1211 | + ), | |
| 1212 | + entry_mode: EntryMode( | |
| 1213 | + 33188, | |
| 1214 | + ), | |
| 1215 | + id: Sha1(e69de29bb2d1d6434b8b29ae775ad8c2e48c5391), | |
| 1216 | + }, | |
| 1217 | + Addition { | |
| 1218 | + location: "gix-sec/Cargo.toml", | |
| 1219 | + relation: Some( | |
| 1220 | + ChildOfParent( | |
| 1221 | + 2, | |
| 1222 | + ), | |
| 1223 | + ), | |
| 1224 | + entry_mode: EntryMode( | |
| 1225 | + 33188, | |
| 1226 | + ), | |
| 1227 | + id: Sha1(e69de29bb2d1d6434b8b29ae775ad8c2e48c5391), | |
| 1228 | + }, | |
| 1229 | + Deletion { | |
| 1230 | + location: "git-sec/src/identity.rs", | |
| 1231 | + relation: Some( | |
| 1232 | + ChildOfParent( | |
| 1233 | + 1, | |
| 1234 | + ), | |
| 1235 | + ), | |
| 1236 | + entry_mode: EntryMode( | |
| 1237 | + 33188, | |
| 1238 | + ), | |
| 1239 | + id: Sha1(e69de29bb2d1d6434b8b29ae775ad8c2e48c5391), | |
| 1240 | + }, | |
| 1241 | + Deletion { | |
| 1242 | + location: "git-sec/src/lib.rs", | |
| 1243 | + relation: Some( | |
| 1244 | + ChildOfParent( | |
| 1245 | + 1, | |
| 1246 | + ), | |
| 1247 | + ), | |
| 1248 | + entry_mode: EntryMode( | |
| 1249 | + 33188, | |
| 1250 | + ), | |
| 1251 | + id: Sha1(e69de29bb2d1d6434b8b29ae775ad8c2e48c5391), | |
| 1252 | + }, | |
| 1253 | + Deletion { | |
| 1254 | + location: "git-sec/src/permission.rs", | |
| 1255 | + relation: Some( | |
| 1256 | + ChildOfParent( | |
| 1257 | + 1, | |
| 1258 | + ), | |
| 1259 | + ), | |
| 1260 | + entry_mode: EntryMode( | |
| 1261 | + 33188, | |
| 1262 | + ), | |
| 1263 | + id: Sha1(e69de29bb2d1d6434b8b29ae775ad8c2e48c5391), | |
| 1264 | + }, | |
| 1265 | + Deletion { | |
| 1266 | + location: "git-sec/src/trust.rs", | |
| 1267 | + relation: Some( | |
| 1268 | + ChildOfParent( | |
| 1269 | + 1, | |
| 1270 | + ), | |
| 1271 | + ), | |
| 1272 | + entry_mode: EntryMode( | |
| 1273 | + 33188, | |
| 1274 | + ), | |
| 1275 | + id: Sha1(e69de29bb2d1d6434b8b29ae775ad8c2e48c5391), | |
| 1276 | + }, | |
| 1277 | + Deletion { | |
| 1278 | + location: "git-sec/tests/sec.rs", | |
| 1279 | + relation: Some( | |
| 1280 | + ChildOfParent( | |
| 1281 | + 1, | |
| 1282 | + ), | |
| 1283 | + ), | |
| 1284 | + entry_mode: EntryMode( | |
| 1285 | + 33188, | |
| 1286 | + ), | |
| 1287 | + id: Sha1(e69de29bb2d1d6434b8b29ae775ad8c2e48c5391), | |
| 1288 | + }, | |
| 1289 | + Addition { | |
| 1290 | + location: "gix-sec/src/identity.rs", | |
| 1291 | + relation: Some( | |
| 1292 | + ChildOfParent( | |
| 1293 | + 2, | |
| 1294 | + ), | |
| 1295 | + ), | |
| 1296 | + entry_mode: EntryMode( | |
| 1297 | + 33188, | |
| 1298 | + ), | |
| 1299 | + id: Sha1(e69de29bb2d1d6434b8b29ae775ad8c2e48c5391), | |
| 1300 | + }, | |
| 1301 | + Addition { | |
| 1302 | + location: "gix-sec/src/lib.rs", | |
| 1303 | + relation: Some( | |
| 1304 | + ChildOfParent( | |
| 1305 | + 2, | |
| 1306 | + ), | |
| 1307 | + ), | |
| 1308 | + entry_mode: EntryMode( | |
| 1309 | + 33188, | |
| 1310 | + ), | |
| 1311 | + id: Sha1(e69de29bb2d1d6434b8b29ae775ad8c2e48c5391), | |
| 1312 | + }, | |
| 1313 | + Addition { | |
| 1314 | + location: "gix-sec/src/permission.rs", | |
| 1315 | + relation: Some( | |
| 1316 | + ChildOfParent( | |
| 1317 | + 2, | |
| 1318 | + ), | |
| 1319 | + ), | |
| 1320 | + entry_mode: EntryMode( | |
| 1321 | + 33188, | |
| 1322 | + ), | |
| 1323 | + id: Sha1(e69de29bb2d1d6434b8b29ae775ad8c2e48c5391), | |
| 1324 | + }, | |
| 1325 | + Addition { | |
| 1326 | + location: "gix-sec/src/trust.rs", | |
| 1327 | + relation: Some( | |
| 1328 | + ChildOfParent( | |
| 1329 | + 2, | |
| 1330 | + ), | |
| 1331 | + ), | |
| 1332 | + entry_mode: EntryMode( | |
| 1333 | + 33188, | |
| 1334 | + ), | |
| 1335 | + id: Sha1(e69de29bb2d1d6434b8b29ae775ad8c2e48c5391), | |
| 1336 | + }, | |
| 1337 | + Addition { | |
| 1338 | + location: "gix-sec/tests/sec.rs", | |
| 1339 | + relation: Some( | |
| 1340 | + ChildOfParent( | |
| 1341 | + 2, | |
| 1342 | + ), | |
| 1343 | + ), | |
| 1344 | + entry_mode: EntryMode( | |
| 1345 | + 33188, | |
| 1346 | + ), | |
| 1347 | + id: Sha1(e69de29bb2d1d6434b8b29ae775ad8c2e48c5391), | |
| 1348 | + }, | |
| 1349 | + Deletion { | |
| 1350 | + location: "git-sec/tests/identity/mod.rs", | |
| 1351 | + relation: Some( | |
| 1352 | + ChildOfParent( | |
| 1353 | + 1, | |
| 1354 | + ), | |
| 1355 | + ), | |
| 1356 | + entry_mode: EntryMode( | |
| 1357 | + 33188, | |
| 1358 | + ), | |
| 1359 | + id: Sha1(e69de29bb2d1d6434b8b29ae775ad8c2e48c5391), | |
| 1360 | + }, | |
| 1361 | + Addition { | |
| 1362 | + location: "gix-sec/tests/identity/mod.rs", | |
| 1363 | + relation: Some( | |
| 1364 | + ChildOfParent( | |
| 1365 | + 2, | |
| 1366 | + ), | |
| 1367 | + ), | |
| 1368 | + entry_mode: EntryMode( | |
| 1369 | + 33188, | |
| 1370 | + ), | |
| 1371 | + id: Sha1(e69de29bb2d1d6434b8b29ae775ad8c2e48c5391), | |
| 1372 | + }, | |
| 1373 | + ] | |
| 1374 | + "#); | |
| 1375 | + | |
| 1376 | + #[cfg(not(windows))] | |
| 1377 | + { | |
| 1378 | + let expected = r#"commit d78c63c5ea3149040767e4387e7fc743cda118fd | |
| 1379 | +Author: author <author@example.com> | |
| 1380 | +Date: Sat Jan 1 00:00:00 2000 +0000 | |
| 1381 | + | |
| 1382 | + r2-change | |
| 1383 | + | |
| 1384 | +diff --git a/git-sec/CHANGELOG.md b/git-sec/CHANGELOG.md | |
| 1385 | +deleted file mode 100644 | |
| 1386 | +index e69de29..0000000 | |
| 1387 | +diff --git a/git-sec/Cargo.toml b/git-sec/Cargo.toml | |
| 1388 | +deleted file mode 100644 | |
| 1389 | +index e69de29..0000000 | |
| 1390 | +diff --git a/git-sec/src/identity.rs b/git-sec/src/identity.rs | |
| 1391 | +deleted file mode 100644 | |
| 1392 | +index e69de29..0000000 | |
| 1393 | +diff --git a/git-sec/src/lib.rs b/git-sec/src/lib.rs | |
| 1394 | +deleted file mode 100644 | |
| 1395 | +index e69de29..0000000 | |
| 1396 | +diff --git a/git-sec/src/permission.rs b/git-sec/src/permission.rs | |
| 1397 | +deleted file mode 100644 | |
| 1398 | +index e69de29..0000000 | |
| 1399 | +diff --git a/git-sec/src/trust.rs b/git-sec/src/trust.rs | |
| 1400 | +deleted file mode 100644 | |
| 1401 | +index e69de29..0000000 | |
| 1402 | +diff --git a/git-sec/tests/identity/mod.rs b/git-sec/tests/identity/mod.rs | |
| 1403 | +deleted file mode 100644 | |
| 1404 | +index e69de29..0000000 | |
| 1405 | +diff --git a/git-sec/tests/sec.rs b/git-sec/tests/sec.rs | |
| 1406 | +deleted file mode 100644 | |
| 1407 | +index e69de29..0000000 | |
| 1408 | +diff --git a/gix-sec/CHANGELOG.md b/gix-sec/CHANGELOG.md | |
| 1409 | +new file mode 100644 | |
| 1410 | +index 0000000..e69de29 | |
| 1411 | +diff --git a/gix-sec/Cargo.toml b/gix-sec/Cargo.toml | |
| 1412 | +new file mode 100644 | |
| 1413 | +index 0000000..e69de29 | |
| 1414 | +diff --git a/gix-sec/src/identity.rs b/gix-sec/src/identity.rs | |
| 1415 | +new file mode 100644 | |
| 1416 | +index 0000000..e69de29 | |
| 1417 | +diff --git a/gix-sec/src/lib.rs b/gix-sec/src/lib.rs | |
| 1418 | +new file mode 100644 | |
| 1419 | +index 0000000..e69de29 | |
| 1420 | +diff --git a/gix-sec/src/permission.rs b/gix-sec/src/permission.rs | |
| 1421 | +new file mode 100644 | |
| 1422 | +index 0000000..e69de29 | |
| 1423 | +diff --git a/gix-sec/src/trust.rs b/gix-sec/src/trust.rs | |
| 1424 | +new file mode 100644 | |
| 1425 | +index 0000000..e69de29 | |
| 1426 | +diff --git a/gix-sec/tests/identity/mod.rs b/gix-sec/tests/identity/mod.rs | |
| 1427 | +new file mode 100644 | |
| 1428 | +index 0000000..e69de29 | |
| 1429 | +diff --git a/gix-sec/tests/sec.rs b/gix-sec/tests/sec.rs | |
| 1430 | +new file mode 100644 | |
| 1431 | +index 0000000..e69de29 | |
| 1432 | +"#; | |
| 1433 | + assert_eq!( | |
| 1434 | + std::fs::read_to_string(repo_workdir()?.join("baseline-2.no-renames"))?, | |
| 1435 | + expected | |
| 1436 | + ); | |
| 1437 | + } | |
| 1438 | + | |
| 1439 | + assert_eq!(out, None, "tracking is disabled completely"); | |
| 1440 | + Ok(()) | |
| 1441 | +} | |
| 1442 | + | |
| 1443 | +#[test] | |
| 1444 | +fn realistic_renames_disabled_3() -> crate::Result { | |
| 1445 | + let (changes, out) = collect_changes_opts( | |
| 1446 | + "r3-base", | |
| 1447 | + "r3-change", | |
| 1448 | + Options { | |
| 1449 | + location: Some(Location::Path), | |
| 1450 | + rewrites: None, | |
| 1451 | + }, | |
| 1452 | + )?; | |
| 1453 | + | |
| 1454 | + insta::assert_debug_snapshot!(changes.into_iter().filter(|c| !c.entry_mode().is_tree()).collect::<Vec<_>>(), @r#" | |
| 1455 | + [ | |
| 1456 | + Addition { | |
| 1457 | + location: "src/ein.rs", | |
| 1458 | + relation: None, | |
| 1459 | + entry_mode: EntryMode( | |
| 1460 | + 33188, | |
| 1461 | + ), | |
| 1462 | + id: Sha1(e69de29bb2d1d6434b8b29ae775ad8c2e48c5391), | |
| 1463 | + }, | |
| 1464 | + Addition { | |
| 1465 | + location: "src/gix.rs", | |
| 1466 | + relation: None, | |
| 1467 | + entry_mode: EntryMode( | |
| 1468 | + 33188, | |
| 1469 | + ), | |
| 1470 | + id: Sha1(e69de29bb2d1d6434b8b29ae775ad8c2e48c5391), | |
| 1471 | + }, | |
| 1472 | + Deletion { | |
| 1473 | + location: "src/plumbing-cli.rs", | |
| 1474 | + relation: None, | |
| 1475 | + entry_mode: EntryMode( | |
| 1476 | + 33188, | |
| 1477 | + ), | |
| 1478 | + id: Sha1(e69de29bb2d1d6434b8b29ae775ad8c2e48c5391), | |
| 1479 | + }, | |
| 1480 | + Deletion { | |
| 1481 | + location: "src/porcelain-cli.rs", | |
| 1482 | + relation: None, | |
| 1483 | + entry_mode: EntryMode( | |
| 1484 | + 33188, | |
| 1485 | + ), | |
| 1486 | + id: Sha1(e69de29bb2d1d6434b8b29ae775ad8c2e48c5391), | |
| 1487 | + }, | |
| 1488 | + ] | |
| 1489 | + "#); | |
| 1490 | + | |
| 1491 | + #[cfg(not(windows))] | |
| 1492 | + { | |
| 1493 | + let expected = r#"commit 0cf7a4fe3ad6c49ae7beb394a1c1df7cc5173ce4 | |
| 1494 | +Author: author <author@example.com> | |
| 1495 | +Date: Sat Jan 1 00:00:00 2000 +0000 | |
| 1496 | + | |
| 1497 | + r3-change | |
| 1498 | + | |
| 1499 | +diff --git a/src/ein.rs b/src/ein.rs | |
| 1500 | +new file mode 100644 | |
| 1501 | +index 0000000..e69de29 | |
| 1502 | +diff --git a/src/gix.rs b/src/gix.rs | |
| 1503 | +new file mode 100644 | |
| 1504 | +index 0000000..e69de29 | |
| 1505 | +diff --git a/src/plumbing-cli.rs b/src/plumbing-cli.rs | |
| 1506 | +deleted file mode 100644 | |
| 1507 | +index e69de29..0000000 | |
| 1508 | +diff --git a/src/porcelain-cli.rs b/src/porcelain-cli.rs | |
| 1509 | +deleted file mode 100644 | |
| 1510 | +index e69de29..0000000 | |
| 1511 | +"#; | |
| 1512 | + | |
| 1513 | + assert_eq!( | |
| 1514 | + std::fs::read_to_string(repo_workdir()?.join("baseline-3.no-renames"))?, | |
| 1515 | + expected | |
| 1516 | + ); | |
| 1517 | + } | |
| 1518 | + | |
| 1519 | + assert_eq!(out, None, "tracking is disabled completely"); | |
| 1520 | + Ok(()) | |
| 1521 | +} | |
| 1522 | + | |
| 1523 | +#[test] | |
| 1524 | +fn realistic_renames_by_identity_3() -> crate::Result { | |
| 1525 | + let (changes, out) = collect_changes_opts( | |
| 1526 | + "r3-base", | |
| 1527 | + "r3-change", | |
| 1528 | + Options { | |
| 1529 | + location: Some(Location::Path), | |
| 1530 | + rewrites: Some(Rewrites { | |
| 1531 | + copies: Some(Copies::default()), | |
| 1532 | + limit: 1, | |
| 1533 | + ..Default::default() | |
| 1534 | + }), | |
| 1535 | + }, | |
| 1536 | + )?; | |
| 1537 | + | |
| 1538 | + insta::assert_debug_snapshot!(changes.into_iter().filter(|c| !c.entry_mode().is_tree()).collect::<Vec<_>>(), @r#" | |
| 1539 | + [ | |
| 1540 | + Rewrite { | |
| 1541 | + source_location: "src/plumbing-cli.rs", | |
| 1542 | + source_entry_mode: EntryMode( | |
| 1543 | + 33188, | |
| 1544 | + ), | |
| 1545 | + source_relation: None, | |
| 1546 | + source_id: Sha1(e69de29bb2d1d6434b8b29ae775ad8c2e48c5391), | |
| 1547 | + diff: None, | |
| 1548 | + entry_mode: EntryMode( | |
| 1549 | + 33188, | |
| 1550 | + ), | |
| 1551 | + id: Sha1(e69de29bb2d1d6434b8b29ae775ad8c2e48c5391), | |
| 1552 | + location: "src/ein.rs", | |
| 1553 | + relation: None, | |
| 1554 | + copy: false, | |
| 1555 | + }, | |
| 1556 | + Rewrite { | |
| 1557 | + source_location: "src/porcelain-cli.rs", | |
| 1558 | + source_entry_mode: EntryMode( | |
| 1559 | + 33188, | |
| 1560 | + ), | |
| 1561 | + source_relation: None, | |
| 1562 | + source_id: Sha1(e69de29bb2d1d6434b8b29ae775ad8c2e48c5391), | |
| 1563 | + diff: None, | |
| 1564 | + entry_mode: EntryMode( | |
| 1565 | + 33188, | |
| 1566 | + ), | |
| 1567 | + id: Sha1(e69de29bb2d1d6434b8b29ae775ad8c2e48c5391), | |
| 1568 | + location: "src/gix.rs", | |
| 1569 | + relation: None, | |
| 1570 | + copy: false, | |
| 1571 | + }, | |
| 1572 | + ] | |
| 1573 | + "#); | |
| 1574 | + | |
| 1575 | + #[cfg(not(windows))] | |
| 1576 | + { | |
| 1577 | + let expected = r#"commit 0cf7a4fe3ad6c49ae7beb394a1c1df7cc5173ce4 | |
| 1578 | +Author: author <author@example.com> | |
| 1579 | +Date: Sat Jan 1 00:00:00 2000 +0000 | |
| 1580 | + | |
| 1581 | + r3-change | |
| 1582 | + | |
| 1583 | +diff --git a/src/plumbing-cli.rs b/src/ein.rs | |
| 1584 | +similarity index 100% | |
| 1585 | +rename from src/plumbing-cli.rs | |
| 1586 | +rename to src/ein.rs | |
| 1587 | +diff --git a/src/porcelain-cli.rs b/src/gix.rs | |
| 1588 | +similarity index 100% | |
| 1589 | +rename from src/porcelain-cli.rs | |
| 1590 | +rename to src/gix.rs | |
| 1591 | +"#; | |
| 1592 | + assert_eq!( | |
| 1593 | + std::fs::read_to_string(repo_workdir()?.join("baseline-3.with-renames"))?, | |
| 1594 | + expected | |
| 1595 | + ); | |
| 1596 | + } | |
| 1597 | + | |
| 1598 | + let out = out.expect("tracking enabled"); | |
| 1599 | + assert_eq!( | |
| 1600 | + out.num_similarity_checks, 0, | |
| 1601 | + "similarity checks disabled, and not necessary" | |
| 1602 | + ); | |
| 1603 | + assert_eq!(out.num_similarity_checks_skipped_for_rename_tracking_due_to_limit, 0); | |
| 1604 | + assert_eq!(out.num_similarity_checks_skipped_for_copy_tracking_due_to_limit, 0); | |
| 1605 | + | |
| 1606 | + Ok(()) | |
| 1607 | +} | |
| 1608 | + | |
| 1609 | +#[test] | |
| 1610 | +fn realistic_renames_2() -> crate::Result { | |
| 1611 | + let (changes, out) = collect_changes_opts( | |
| 1612 | + "r2-base", | |
| 1613 | + "r2-change", | |
| 1614 | + Options { | |
| 1615 | + location: Some(Location::Path), | |
| 1616 | + rewrites: Some(Rewrites { | |
| 1617 | + copies: Some(Copies::default()), | |
| 1618 | + limit: 1, | |
| 1619 | + ..Default::default() | |
| 1620 | + }), | |
| 1621 | + }, | |
| 1622 | + )?; | |
| 1623 | + | |
| 1624 | + // Look how nicely it captures and associates this directory rename. | |
| 1625 | + insta::assert_debug_snapshot!(changes.into_iter() | |
| 1626 | + .filter(|c| !c.entry_mode().is_tree() || | |
| 1627 | + c.relation().map_or(false, |r| matches!(r, Relation::Parent(_))) | |
| 1628 | + ).collect::<Vec<_>>(), @r#" | |
| 1629 | + [ | |
| 1630 | + Rewrite { | |
| 1631 | + source_location: "git-sec", | |
| 1632 | + source_entry_mode: EntryMode( | |
| 1633 | + 16384, | |
| 1634 | + ), | |
| 1635 | + source_relation: Some( | |
| 1636 | + Parent( | |
| 1637 | + 1, | |
| 1638 | + ), | |
| 1639 | + ), | |
| 1640 | + source_id: Sha1(0026010e87631065a2739f627622feb14f903fd4), | |
| 1641 | + diff: None, | |
| 1642 | + entry_mode: EntryMode( | |
| 1643 | + 16384, | |
| 1644 | + ), | |
| 1645 | + id: Sha1(0026010e87631065a2739f627622feb14f903fd4), | |
| 1646 | + location: "gix-sec", | |
| 1647 | + relation: Some( | |
| 1648 | + Parent( | |
| 1649 | + 2, | |
| 1650 | + ), | |
| 1651 | + ), | |
| 1652 | + copy: false, | |
| 1653 | + }, | |
| 1654 | + Rewrite { | |
| 1655 | + source_location: "git-sec/CHANGELOG.md", | |
| 1656 | + source_entry_mode: EntryMode( | |
| 1657 | + 33188, | |
| 1658 | + ), | |
| 1659 | + source_relation: Some( | |
| 1660 | + ChildOfParent( | |
| 1661 | + 1, | |
| 1662 | + ), | |
| 1663 | + ), | |
| 1664 | + source_id: Sha1(e69de29bb2d1d6434b8b29ae775ad8c2e48c5391), | |
| 1665 | + diff: None, | |
| 1666 | + entry_mode: EntryMode( | |
| 1667 | + 33188, | |
| 1668 | + ), | |
| 1669 | + id: Sha1(e69de29bb2d1d6434b8b29ae775ad8c2e48c5391), | |
| 1670 | + location: "gix-sec/CHANGELOG.md", | |
| 1671 | + relation: Some( | |
| 1672 | + ChildOfParent( | |
| 1673 | + 2, | |
| 1674 | + ), | |
| 1675 | + ), | |
| 1676 | + copy: false, | |
| 1677 | + }, | |
| 1678 | + Rewrite { | |
| 1679 | + source_location: "git-sec/Cargo.toml", | |
| 1680 | + source_entry_mode: EntryMode( | |
| 1681 | + 33188, | |
| 1682 | + ), | |
| 1683 | + source_relation: Some( | |
| 1684 | + ChildOfParent( | |
| 1685 | + 1, | |
| 1686 | + ), | |
| 1687 | + ), | |
| 1688 | + source_id: Sha1(e69de29bb2d1d6434b8b29ae775ad8c2e48c5391), | |
| 1689 | + diff: None, | |
| 1690 | + entry_mode: EntryMode( | |
| 1691 | + 33188, | |
| 1692 | + ), | |
| 1693 | + id: Sha1(e69de29bb2d1d6434b8b29ae775ad8c2e48c5391), | |
| 1694 | + location: "gix-sec/Cargo.toml", | |
| 1695 | + relation: Some( | |
| 1696 | + ChildOfParent( | |
| 1697 | + 2, | |
| 1698 | + ), | |
| 1699 | + ), | |
| 1700 | + copy: false, | |
| 1701 | + }, | |
| 1702 | + Rewrite { | |
| 1703 | + source_location: "git-sec/src/identity.rs", | |
| 1704 | + source_entry_mode: EntryMode( | |
| 1705 | + 33188, | |
| 1706 | + ), | |
| 1707 | + source_relation: Some( | |
| 1708 | + ChildOfParent( | |
| 1709 | + 1, | |
| 1710 | + ), | |
| 1711 | + ), | |
| 1712 | + source_id: Sha1(e69de29bb2d1d6434b8b29ae775ad8c2e48c5391), | |
| 1713 | + diff: None, | |
| 1714 | + entry_mode: EntryMode( | |
| 1715 | + 33188, | |
| 1716 | + ), | |
| 1717 | + id: Sha1(e69de29bb2d1d6434b8b29ae775ad8c2e48c5391), | |
| 1718 | + location: "gix-sec/src/identity.rs", | |
| 1719 | + relation: Some( | |
| 1720 | + ChildOfParent( | |
| 1721 | + 2, | |
| 1722 | + ), | |
| 1723 | + ), | |
| 1724 | + copy: false, | |
| 1725 | + }, | |
| 1726 | + Rewrite { | |
| 1727 | + source_location: "git-sec/src/lib.rs", | |
| 1728 | + source_entry_mode: EntryMode( | |
| 1729 | + 33188, | |
| 1730 | + ), | |
| 1731 | + source_relation: Some( | |
| 1732 | + ChildOfParent( | |
| 1733 | + 1, | |
| 1734 | + ), | |
| 1735 | + ), | |
| 1736 | + source_id: Sha1(e69de29bb2d1d6434b8b29ae775ad8c2e48c5391), | |
| 1737 | + diff: None, | |
| 1738 | + entry_mode: EntryMode( | |
| 1739 | + 33188, | |
| 1740 | + ), | |
| 1741 | + id: Sha1(e69de29bb2d1d6434b8b29ae775ad8c2e48c5391), | |
| 1742 | + location: "gix-sec/src/lib.rs", | |
| 1743 | + relation: Some( | |
| 1744 | + ChildOfParent( | |
| 1745 | + 2, | |
| 1746 | + ), | |
| 1747 | + ), | |
| 1748 | + copy: false, | |
| 1749 | + }, | |
| 1750 | + Rewrite { | |
| 1751 | + source_location: "git-sec/src/permission.rs", | |
| 1752 | + source_entry_mode: EntryMode( | |
| 1753 | + 33188, | |
| 1754 | + ), | |
| 1755 | + source_relation: Some( | |
| 1756 | + ChildOfParent( | |
| 1757 | + 1, | |
| 1758 | + ), | |
| 1759 | + ), | |
| 1760 | + source_id: Sha1(e69de29bb2d1d6434b8b29ae775ad8c2e48c5391), | |
| 1761 | + diff: None, | |
| 1762 | + entry_mode: EntryMode( | |
| 1763 | + 33188, | |
| 1764 | + ), | |
| 1765 | + id: Sha1(e69de29bb2d1d6434b8b29ae775ad8c2e48c5391), | |
| 1766 | + location: "gix-sec/src/permission.rs", | |
| 1767 | + relation: Some( | |
| 1768 | + ChildOfParent( | |
| 1769 | + 2, | |
| 1770 | + ), | |
| 1771 | + ), | |
| 1772 | + copy: false, | |
| 1773 | + }, | |
| 1774 | + Rewrite { | |
| 1775 | + source_location: "git-sec/src/trust.rs", | |
| 1776 | + source_entry_mode: EntryMode( | |
| 1777 | + 33188, | |
| 1778 | + ), | |
| 1779 | + source_relation: Some( | |
| 1780 | + ChildOfParent( | |
| 1781 | + 1, | |
| 1782 | + ), | |
| 1783 | + ), | |
| 1784 | + source_id: Sha1(e69de29bb2d1d6434b8b29ae775ad8c2e48c5391), | |
| 1785 | + diff: None, | |
| 1786 | + entry_mode: EntryMode( | |
| 1787 | + 33188, | |
| 1788 | + ), | |
| 1789 | + id: Sha1(e69de29bb2d1d6434b8b29ae775ad8c2e48c5391), | |
| 1790 | + location: "gix-sec/src/trust.rs", | |
| 1791 | + relation: Some( | |
| 1792 | + ChildOfParent( | |
| 1793 | + 2, | |
| 1794 | + ), | |
| 1795 | + ), | |
| 1796 | + copy: false, | |
| 1797 | + }, | |
| 1798 | + Rewrite { | |
| 1799 | + source_location: "git-sec/tests/sec.rs", | |
| 1800 | + source_entry_mode: EntryMode( | |
| 1801 | + 33188, | |
| 1802 | + ), | |
| 1803 | + source_relation: Some( | |
| 1804 | + ChildOfParent( | |
| 1805 | + 1, | |
| 1806 | + ), | |
| 1807 | + ), | |
| 1808 | + source_id: Sha1(e69de29bb2d1d6434b8b29ae775ad8c2e48c5391), | |
| 1809 | + diff: None, | |
| 1810 | + entry_mode: EntryMode( | |
| 1811 | + 33188, | |
| 1812 | + ), | |
| 1813 | + id: Sha1(e69de29bb2d1d6434b8b29ae775ad8c2e48c5391), | |
| 1814 | + location: "gix-sec/tests/sec.rs", | |
| 1815 | + relation: Some( | |
| 1816 | + ChildOfParent( | |
| 1817 | + 2, | |
| 1818 | + ), | |
| 1819 | + ), | |
| 1820 | + copy: false, | |
| 1821 | + }, | |
| 1822 | + Rewrite { | |
| 1823 | + source_location: "git-sec/tests/identity/mod.rs", | |
| 1824 | + source_entry_mode: EntryMode( | |
| 1825 | + 33188, | |
| 1826 | + ), | |
| 1827 | + source_relation: Some( | |
| 1828 | + ChildOfParent( | |
| 1829 | + 1, | |
| 1830 | + ), | |
| 1831 | + ), | |
| 1832 | + source_id: Sha1(e69de29bb2d1d6434b8b29ae775ad8c2e48c5391), | |
| 1833 | + diff: None, | |
| 1834 | + entry_mode: EntryMode( | |
| 1835 | + 33188, | |
| 1836 | + ), | |
| 1837 | + id: Sha1(e69de29bb2d1d6434b8b29ae775ad8c2e48c5391), | |
| 1838 | + location: "gix-sec/tests/identity/mod.rs", | |
| 1839 | + relation: Some( | |
| 1840 | + ChildOfParent( | |
| 1841 | + 2, | |
| 1842 | + ), | |
| 1843 | + ), | |
| 1844 | + copy: false, | |
| 1845 | + }, | |
| 1846 | + ] | |
| 1847 | + "#); | |
| 1848 | + | |
| 1849 | + #[cfg(not(windows))] | |
| 1850 | + { | |
| 1851 | + let expected = r#"commit d78c63c5ea3149040767e4387e7fc743cda118fd | |
| 1852 | +Author: author <author@example.com> | |
| 1853 | +Date: Sat Jan 1 00:00:00 2000 +0000 | |
| 1854 | + | |
| 1855 | + r2-change | |
| 1856 | + | |
| 1857 | +diff --git a/git-sec/CHANGELOG.md b/gix-sec/CHANGELOG.md | |
| 1858 | +similarity index 100% | |
| 1859 | +rename from git-sec/CHANGELOG.md | |
| 1860 | +rename to gix-sec/CHANGELOG.md | |
| 1861 | +diff --git a/git-sec/Cargo.toml b/gix-sec/Cargo.toml | |
| 1862 | +similarity index 100% | |
| 1863 | +rename from git-sec/Cargo.toml | |
| 1864 | +rename to gix-sec/Cargo.toml | |
| 1865 | +diff --git a/git-sec/src/identity.rs b/gix-sec/src/identity.rs | |
| 1866 | +similarity index 100% | |
| 1867 | +rename from git-sec/src/identity.rs | |
| 1868 | +rename to gix-sec/src/identity.rs | |
| 1869 | +diff --git a/git-sec/src/lib.rs b/gix-sec/src/lib.rs | |
| 1870 | +similarity index 100% | |
| 1871 | +rename from git-sec/src/lib.rs | |
| 1872 | +rename to gix-sec/src/lib.rs | |
| 1873 | +diff --git a/git-sec/src/permission.rs b/gix-sec/src/permission.rs | |
| 1874 | +similarity index 100% | |
| 1875 | +rename from git-sec/src/permission.rs | |
| 1876 | +rename to gix-sec/src/permission.rs | |
| 1877 | +diff --git a/git-sec/src/trust.rs b/gix-sec/src/trust.rs | |
| 1878 | +similarity index 100% | |
| 1879 | +rename from git-sec/src/trust.rs | |
| 1880 | +rename to gix-sec/src/trust.rs | |
| 1881 | +diff --git a/git-sec/tests/identity/mod.rs b/gix-sec/tests/identity/mod.rs | |
| 1882 | +similarity index 100% | |
| 1883 | +rename from git-sec/tests/identity/mod.rs | |
| 1884 | +rename to gix-sec/tests/identity/mod.rs | |
| 1885 | +diff --git a/git-sec/tests/sec.rs b/gix-sec/tests/sec.rs | |
| 1886 | +similarity index 100% | |
| 1887 | +rename from git-sec/tests/sec.rs | |
| 1888 | +rename to gix-sec/tests/sec.rs | |
| 1889 | +"#; | |
| 1890 | + assert_eq!( | |
| 1891 | + std::fs::read_to_string(repo_workdir()?.join("baseline-2.with-renames"))?, | |
| 1892 | + expected | |
| 1893 | + ); | |
| 1894 | + } | |
| 1895 | + | |
| 1896 | + let out = out.expect("tracking enabled"); | |
| 1897 | + assert_eq!( | |
| 1898 | + out.num_similarity_checks, 0, | |
| 1899 | + "similarity checks disabled, and not necessary" | |
| 1900 | + ); | |
| 1901 | + assert_eq!(out.num_similarity_checks_skipped_for_rename_tracking_due_to_limit, 0); | |
| 1902 | + assert_eq!(out.num_similarity_checks_skipped_for_copy_tracking_due_to_limit, 0); | |
| 1903 | + | |
| 1904 | + Ok(()) | |
| 1905 | +} | |
| 1906 | + | |
| 1907 | +mod util { | |
| 1908 | + use gix_diff::rewrites; | |
| 1909 | + use gix_object::{FindExt, TreeRefIter}; | |
| 1910 | + use std::convert::Infallible; | |
| 1911 | + use std::path::{Path, PathBuf}; | |
| 1912 | + | |
| 1913 | + pub fn repo_workdir() -> crate::Result<PathBuf> { | |
| 1914 | + gix_testtools::scripted_fixture_read_only_standalone("make_diff_for_rewrites_repo.sh") | |
| 1915 | + } | |
| 1916 | + | |
| 1917 | + pub fn repo_with_trees( | |
| 1918 | + lhs: impl Into<Option<&'static str>>, | |
| 1919 | + rhs: impl Into<Option<&'static str>>, | |
| 1920 | + ) -> gix_testtools::Result<(Vec<u8>, Vec<u8>, gix_diff::blob::Platform, gix_odb::Handle)> { | |
| 1921 | + let root = repo_workdir()?; | |
| 1922 | + let odb = gix_odb::at(root.join(".git/objects"))?; | |
| 1923 | + let lhs = read_tree(&odb, &root, lhs.into())?; | |
| 1924 | + let rhs = read_tree(&odb, &root, rhs.into())?; | |
| 1925 | + | |
| 1926 | + let cache = gix_diff::blob::Platform::new( | |
| 1927 | + Default::default(), | |
| 1928 | + gix_diff::blob::Pipeline::new(Default::default(), Default::default(), Vec::new(), Default::default()), | |
| 1929 | + Default::default(), | |
| 1930 | + gix_worktree::Stack::new( | |
| 1931 | + &root, | |
| 1932 | + gix_worktree::stack::State::AttributesStack(gix_worktree::stack::state::Attributes::default()), | |
| 1933 | + Default::default(), | |
| 1934 | + Vec::new(), | |
| 1935 | + Vec::new(), | |
| 1936 | + ), | |
| 1937 | + ); | |
| 1938 | + Ok((lhs, rhs, cache, odb)) | |
| 1939 | + } | |
| 1940 | + | |
| 1941 | + pub fn collect_changes( | |
| 1942 | + lhs: impl Into<Option<&'static str>>, | |
| 1943 | + rhs: impl Into<Option<&'static str>>, | |
| 1944 | + ) -> gix_testtools::Result<(Vec<gix_diff::tree_with_rewrites::Change>, Option<rewrites::Outcome>)> { | |
| 1945 | + let options = gix_diff::tree_with_rewrites::Options { | |
| 1946 | + location: Some(gix_diff::tree::recorder::Location::Path), | |
| 1947 | + rewrites: None, | |
| 1948 | + }; | |
| 1949 | + collect_changes_opts(lhs, rhs, options) | |
| 1950 | + } | |
| 1951 | + | |
| 1952 | + pub fn collect_changes_opts( | |
| 1953 | + lhs: impl Into<Option<&'static str>>, | |
| 1954 | + rhs: impl Into<Option<&'static str>>, | |
| 1955 | + options: gix_diff::tree_with_rewrites::Options, | |
| 1956 | + ) -> gix_testtools::Result<(Vec<gix_diff::tree_with_rewrites::Change>, Option<rewrites::Outcome>)> { | |
| 1957 | + let (from, to, mut cache, odb) = repo_with_trees(lhs, rhs)?; | |
| 1958 | + let mut out = Vec::new(); | |
| 1959 | + let rewrites_info = gix_diff::tree_with_rewrites( | |
| 1960 | + TreeRefIter::from_bytes(&from), | |
| 1961 | + TreeRefIter::from_bytes(&to), | |
| 1962 | + &mut cache, | |
| 1963 | + &mut Default::default(), | |
| 1964 | + &odb, | |
| 1965 | + |change| -> Result<_, Infallible> { | |
| 1966 | + out.push(change.into_owned()); | |
| 1967 | + Ok(gix_diff::tree_with_rewrites::Action::Continue) | |
| 1968 | + }, | |
| 1969 | + options, | |
| 1970 | + )?; | |
| 1971 | + Ok((out, rewrites_info)) | |
| 1972 | + } | |
| 1973 | + | |
| 1974 | + fn read_tree(odb: &dyn gix_object::Find, root: &Path, tree: Option<&str>) -> gix_testtools::Result<Vec<u8>> { | |
| 1975 | + let Some(tree) = tree else { return Ok(Vec::new()) }; | |
| 1976 | + let tree_id_path = root.join(tree).with_extension("tree"); | |
| 1977 | + let hex_id = std::fs::read_to_string(&tree_id_path).map_err(|err| { | |
| 1978 | + std::io::Error::new( | |
| 1979 | + std::io::ErrorKind::Other, | |
| 1980 | + format!("Could not read '{}': {}", tree_id_path.display(), err), | |
| 1981 | + ) | |
| 1982 | + })?; | |
| 1983 | + let tree_id = gix_hash::ObjectId::from_hex(hex_id.trim().as_bytes())?; | |
| 1984 | + let mut buf = Vec::new(); | |
| 1985 | + odb.find_tree(&tree_id, &mut buf)?; | |
| 1986 | + Ok(buf) | |
| 1987 | + } | |
| 1988 | +} | |
| 1989 | +use util::{collect_changes, collect_changes_opts, repo_with_trees, repo_workdir}; | |
Binary file not shown.
| @@ -0,0 +1,797 @@ | ||
| 1 | +#!/usr/bin/env bash | |
| 2 | +set -eu -o pipefail | |
| 3 | + | |
| 4 | +function store_tree() { | |
| 5 | + local revspec="${1:?the commit to get the tree for}" | |
| 6 | + local current_commit | |
| 7 | + current_commit=$(git rev-parse HEAD) | |
| 8 | + git rev-parse "${current_commit}^{tree}" > ../"$revspec".tree | |
| 9 | +} | |
| 10 | + | |
| 11 | +git init -q | |
| 12 | + | |
| 13 | +cat <<EOF >>.git/config | |
| 14 | + | |
| 15 | +[diff "binary-true"] | |
| 16 | + binary = true | |
| 17 | +[diff "binary-false"] | |
| 18 | + binary = false | |
| 19 | +[diff ""] | |
| 20 | + command = "empty is ignored" | |
| 21 | +[diff] | |
| 22 | + command = "this is also ignored as sub-section name is missing" | |
| 23 | + algorithm = histogram | |
| 24 | +[diff "all-but-binary"] | |
| 25 | + command = command | |
| 26 | + textconv = textconv | |
| 27 | + algorithm = histogram | |
| 28 | + binary = auto | |
| 29 | +EOF | |
| 30 | + | |
| 31 | +git checkout -b main | |
| 32 | +mkdir dir | |
| 33 | +touch a b dir/c d | |
| 34 | +git add . | |
| 35 | +git commit -q -m "c1 - initial" | |
| 36 | +store_tree "c1 - initial" | |
| 37 | + | |
| 38 | +echo a >> a | |
| 39 | +echo b >> b | |
| 40 | +echo dir/c >> dir/c | |
| 41 | +echo d >> d | |
| 42 | +git commit -q -am "c2" | |
| 43 | +store_tree "c2" | |
| 44 | + | |
| 45 | +echo a1 >> a | |
| 46 | +echo dir/c1 >> dir/c | |
| 47 | +git commit -q -am "c3-modification" | |
| 48 | +store_tree "c3-modification" | |
| 49 | + | |
| 50 | +git mv a dir/a-moved | |
| 51 | +git commit -m "r1-identity" | |
| 52 | +store_tree "r1-identity" | |
| 53 | + | |
| 54 | +touch s1 s2 s3 | |
| 55 | +git add s* && git commit -m "c4 - add identical files" | |
| 56 | +store_tree "c4 - add identical files" | |
| 57 | + | |
| 58 | +git mv s1 z && git mv s2 b2 && git mv s3 b1 | |
| 59 | +git commit -m "r2-ambiguous" | |
| 60 | +store_tree "r2-ambiguous" | |
| 61 | + | |
| 62 | +git mv dir/c dir/c-moved | |
| 63 | +echo dir/cn >> dir/c-moved | |
| 64 | +echo n >> b | |
| 65 | +git commit -am "r3-simple" # modified rename and normal modification | |
| 66 | +store_tree "r3-simple" | |
| 67 | + | |
| 68 | +touch lt1 lt2 | |
| 69 | +ln -s lt1 link-1 | |
| 70 | +echo lt1 > no-link # a file that has content like a link and a similar name | |
| 71 | +ln -s ../lt2 dir/link-2 | |
| 72 | +git add . && git commit -m "c5 - add links" | |
| 73 | +store_tree "c5 - add links" | |
| 74 | + | |
| 75 | +git mv link-1 renamed-link-1 | |
| 76 | +git rm no-link | |
| 77 | +git rm dir/link-2 && ln -s lt1 z-link-2 && git add . | |
| 78 | +git commit -m "r4-symlinks" # symlinks are only tracked by identity | |
| 79 | +store_tree "r4-symlinks" | |
| 80 | + | |
| 81 | +seq 10 > f1 | |
| 82 | +seq 11 > f2 | |
| 83 | +git add . && git commit -m "c6 - two files with more content" | |
| 84 | +store_tree "c6" | |
| 85 | + | |
| 86 | +echo n >> f1 | |
| 87 | +echo n >> f2 | |
| 88 | +git mv f1 f1-renamed | |
| 89 | +git mv f2 f2-renamed | |
| 90 | + | |
| 91 | +git commit -am "r5" # two renames | |
| 92 | +store_tree "r5" | |
| 93 | + | |
| 94 | + | |
| 95 | +seq 9 > base | |
| 96 | +git add base | |
| 97 | +git commit -m "c7" # base has to be added | |
| 98 | +store_tree "c7" | |
| 99 | + | |
| 100 | +echo 10 >> base | |
| 101 | +cp base c1 | |
| 102 | +cp base c2 | |
| 103 | +cp base dir/c3 | |
| 104 | +git add . && git commit -m "tc1-identity" | |
| 105 | +store_tree "tc1-identity" | |
| 106 | + | |
| 107 | +echo 11 >> base | |
| 108 | +cp base c4 # can be located by identity | |
| 109 | +cp base c5 && echo 12 >> c5 | |
| 110 | +cp base dir/c6 && echo 13 >> dir/c6 | |
| 111 | +git add . && git commit -m "tc2-similarity" | |
| 112 | +store_tree "tc2-similarity" | |
| 113 | + | |
| 114 | +cp base c6 # can be located by identity, but base needs --find-copies-harder | |
| 115 | +cp base c7 && echo 13 >> c7 # modified copy, similarity and find copies harder | |
| 116 | +seq 15 > newly-added | |
| 117 | +echo nn >> b | |
| 118 | +git add . | |
| 119 | +git commit -m "tc3-find-harder" | |
| 120 | +store_tree "tc3-find-harder" | |
| 121 | + | |
| 122 | +rm -Rf ./* | |
| 123 | +# from 92de081dc9ab5660cb18fa750452345dd63550ea~1 of `gitoxide` | |
| 124 | +while read -r _ _ _ path; do | |
| 125 | + mkdir -p ${path%/*} && touch $path | |
| 126 | +done <<EOF | |
| 127 | +100644 blob 4d3da1c26ebc6e0edf617ff3cc8087eab493f61a git-index/CHANGELOG.md | |
| 128 | +100644 blob 921fafb8ad45eb9932b607cf51b9640b7a74f324 git-index/Cargo.toml | |
| 129 | +100644 blob f239be693c0106cbd46e7889f718c7e41eb51fb0 git-index/README.md | |
| 130 | +100644 blob c72fd75ad38b88f06e559f64f75f88d836678e6c git-index/src/access.rs | |
| 131 | +100644 blob f33602637b28b008334fcc09cdd9f7085684158a git-index/src/decode/entries.rs | |
| 132 | +100644 blob 097807dd511b5e087f465cac1ba8bb5983890a78 git-index/src/decode/header.rs | |
| 133 | +100644 blob 82a6229681818d2c70764adf1e64814e37b9eb9e git-index/src/decode/mod.rs | |
| 134 | +100644 blob be72ef7281e4cdad10916f06e2ec5418202ef634 git-index/src/entry.rs | |
| 135 | +100644 blob 5bf6699a611725ee47ed781acf75af387c68fd6c git-index/src/extension/decode.rs | |
| 136 | +100644 blob c44d15b295ceabb6d36fef7f2f0e69e4d8a8f28c git-index/src/extension/end_of_index_entry.rs | |
| 137 | +100644 blob 117fd21dfcdb497d0ab840c16bbe34d4a12c01c9 git-index/src/extension/fs_monitor.rs | |
| 138 | +100644 blob 9d0cab23d7123417d81bfbf34b5ef8add4432f20 git-index/src/extension/index_entry_offset_table.rs | |
| 139 | +100644 blob ec7c559e23ecd6492f23d43d39d9be7b70b9b539 git-index/src/extension/iter.rs | |
| 140 | +100644 blob 507f60db60d6b6b54942cdd6e48b13e8e568ada4 git-index/src/extension/link.rs | |
| 141 | +100644 blob cbf7c0e313f00b5dae2bea5566c639d29a03701f git-index/src/extension/mod.rs | |
| 142 | +100644 blob d263a47c0e9036a89a20b004e55ef37f1f6a8a18 git-index/src/extension/resolve_undo.rs | |
| 143 | +100644 blob ec0fa25f9e933c9a1e875f44017b9df12800f95b git-index/src/extension/tree.rs | |
| 144 | +100644 blob abf223eeb3b773c8c65a6aae300c137bad93d991 git-index/src/extension/untracked_cache.rs | |
| 145 | +100644 blob 700c7934b39e652c362f71dac5431185fe51abf3 git-index/src/file.rs | |
| 146 | +100644 blob 3e06aa76960b11e1c91158a06de0fb11fb94921c git-index/src/file/init.rs | |
| 147 | +100644 blob 29b76829ecdef3a3994e3bec52c0035b1bdb3ae2 git-index/src/file/verify.rs | |
| 148 | +100644 blob c1b9699ddf6c46d38cb52279a2d67cb06e76107e git-index/src/lib.rs | |
| 149 | +100644 blob 998a49e3127518b1c13a6e7e95a1bce1397896fa git-index/src/verify.rs | |
| 150 | +100644 blob 50def2768ea1c917f637d0c0db2046426c05944d git-index/src/write.rs | |
| 151 | +100644 blob 85f637142bd20a3513b7d2ebfd60f99b21418507 git-index/tests/fixtures/generated-archives/V2_empty.tar.xz | |
| 152 | +100644 blob 6f22567cdd33e5af04eaf6534b59c02e23fb91bd git-index/tests/fixtures/generated-archives/v2.tar.xz | |
| 153 | +100644 blob 902ebe2e2e9012d5d0f838bcd1ceaa3cc31e18f0 git-index/tests/fixtures/generated-archives/v2_more_files.tar.xz | |
| 154 | +100644 blob 53973a1923b39bbae435a9ebd10d37eee4521281 git-index/tests/fixtures/generated-archives/v2_split_index.tar.xz | |
| 155 | +100644 blob c0f22de0620e424ef44393745b35368ad0164851 git-index/tests/fixtures/generated-archives/v4_more_files_IEOT.tar.xz | |
| 156 | +100644 blob ec8c20111ec1ebbad5654ff9c7c9ac1f3f138e52 git-index/tests/fixtures/loose_index/FSMN.git-index | |
| 157 | +100644 blob 5aa997c6f8cf6660cbe7108654e1d495301e890b git-index/tests/fixtures/loose_index/REUC.git-index | |
| 158 | +100644 blob d77985692ab14f02c70c3472b58d0cfd60c145ca git-index/tests/fixtures/loose_index/REUC.on-90d242d36e248acfae0033274b524bfa55a947fd.git-patch | |
| 159 | +100644 blob b36ae38974754043ee46f7ca3d6b55fb977e9125 git-index/tests/fixtures/loose_index/UNTR-with-oids.git-index | |
| 160 | +100644 blob 410996317bfadd1cec7229be65887b25342a6136 git-index/tests/fixtures/loose_index/UNTR-with-oids.on-90d242d36e248acfae0033274b524bfa55a947fd.git-patch | |
| 161 | +100644 blob e5d1c3cba599ef1e1347f43283fa3991382a66c3 git-index/tests/fixtures/loose_index/UNTR.git-index | |
| 162 | +100644 blob 0e253a5955f2ec02b4764002d008db426ba15e1b git-index/tests/fixtures/loose_index/conflicting-file.git-index | |
| 163 | +100644 blob f03713b684711d4a5aedab0bafd6b254137c9e5d git-index/tests/fixtures/loose_index/extended-flags.git-index | |
| 164 | +100644 blob f2c7d2ab253a69e8c693f58b72e84d1145bbdf90 git-index/tests/fixtures/loose_index/very-long-path.git-index | |
| 165 | +100644 blob 1eb48b72b8c15924c86e21da4bccd48d80e7e3fc git-index/tests/fixtures/make_index/V2_empty.sh | |
| 166 | +100644 blob a61c9527d01147eaddb846aa3e266e9b00cfa3e3 git-index/tests/fixtures/make_index/v2.sh | |
| 167 | +100644 blob d4cafddc09766f8b75d10bc45a41ffb60a40054a git-index/tests/fixtures/make_index/v2_more_files.sh | |
| 168 | +100644 blob 0b5c98e5ed863df3c001ec4634e2baabc4ba5d39 git-index/tests/fixtures/make_index/v2_split_index.sh | |
| 169 | +100644 blob 3b22aaa66924d970117f6148ccf5a5cdf0c52121 git-index/tests/fixtures/make_index/v4_more_files_IEOT.sh | |
| 170 | +100644 blob 936bcb7f42836f75d96b57045786a2d48b9a4c56 git-index/tests/index-multi-threaded.rs | |
| 171 | +100644 blob 4dcec528c1e96ccac6f98458619ba403bac1af97 git-index/tests/index-single-threaded.rs | |
| 172 | +100644 blob f7cdac660789401af818c9e9ba44aa18404bbed6 git-index/tests/index/file/mod.rs | |
| 173 | +100644 blob c8c055934ac028ebc5f9952529f9b252fec00870 git-index/tests/index/file/read.rs | |
| 174 | +100644 blob aa43428167b4598138cc1b468ffc904381042e82 git-index/tests/index/file/write.rs | |
| 175 | +100644 blob bb32d174af2d06c31aacc880ea340e0748d2aa1a git-index/tests/index/mod.rs | |
| 176 | +EOF | |
| 177 | +git add . && git commit -m "r1-base" | |
| 178 | +store_tree "r1-base" | |
| 179 | + | |
| 180 | +rm -Rf ./* | |
| 181 | +# from 92de081dc9ab5660cb18fa750452345dd63550ea of `gitoxide` | |
| 182 | +while read -r _ _ _ path; do | |
| 183 | + mkdir -p ${path%/*} && touch $path | |
| 184 | +done <<EOF | |
| 185 | +100644 blob 4d3da1c26ebc6e0edf617ff3cc8087eab493f61a git-index/CHANGELOG.md | |
| 186 | +100644 blob 921fafb8ad45eb9932b607cf51b9640b7a74f324 git-index/Cargo.toml | |
| 187 | +100644 blob f239be693c0106cbd46e7889f718c7e41eb51fb0 git-index/README.md | |
| 188 | +100644 blob c72fd75ad38b88f06e559f64f75f88d836678e6c git-index/src/access.rs | |
| 189 | +100644 blob f33602637b28b008334fcc09cdd9f7085684158a git-index/src/decode/entries.rs | |
| 190 | +100644 blob 097807dd511b5e087f465cac1ba8bb5983890a78 git-index/src/decode/header.rs | |
| 191 | +100644 blob 82a6229681818d2c70764adf1e64814e37b9eb9e git-index/src/decode/mod.rs | |
| 192 | +100644 blob be72ef7281e4cdad10916f06e2ec5418202ef634 git-index/src/entry.rs | |
| 193 | +100644 blob 5bf6699a611725ee47ed781acf75af387c68fd6c git-index/src/extension/decode.rs | |
| 194 | +100644 blob c44d15b295ceabb6d36fef7f2f0e69e4d8a8f28c git-index/src/extension/end_of_index_entry.rs | |
| 195 | +100644 blob 117fd21dfcdb497d0ab840c16bbe34d4a12c01c9 git-index/src/extension/fs_monitor.rs | |
| 196 | +100644 blob 9d0cab23d7123417d81bfbf34b5ef8add4432f20 git-index/src/extension/index_entry_offset_table.rs | |
| 197 | +100644 blob ec7c559e23ecd6492f23d43d39d9be7b70b9b539 git-index/src/extension/iter.rs | |
| 198 | +100644 blob 507f60db60d6b6b54942cdd6e48b13e8e568ada4 git-index/src/extension/link.rs | |
| 199 | +100644 blob cbf7c0e313f00b5dae2bea5566c639d29a03701f git-index/src/extension/mod.rs | |
| 200 | +100644 blob d263a47c0e9036a89a20b004e55ef37f1f6a8a18 git-index/src/extension/resolve_undo.rs | |
| 201 | +100644 blob ec0fa25f9e933c9a1e875f44017b9df12800f95b git-index/src/extension/tree.rs | |
| 202 | +100644 blob abf223eeb3b773c8c65a6aae300c137bad93d991 git-index/src/extension/untracked_cache.rs | |
| 203 | +100644 blob 3e06aa76960b11e1c91158a06de0fb11fb94921c git-index/src/file/init.rs | |
| 204 | +100644 blob 700c7934b39e652c362f71dac5431185fe51abf3 git-index/src/file/mod.rs | |
| 205 | +100644 blob 29b76829ecdef3a3994e3bec52c0035b1bdb3ae2 git-index/src/file/verify.rs | |
| 206 | +100644 blob c1b9699ddf6c46d38cb52279a2d67cb06e76107e git-index/src/lib.rs | |
| 207 | +100644 blob 998a49e3127518b1c13a6e7e95a1bce1397896fa git-index/src/verify.rs | |
| 208 | +100644 blob 50def2768ea1c917f637d0c0db2046426c05944d git-index/src/write.rs | |
| 209 | +100644 blob 85f637142bd20a3513b7d2ebfd60f99b21418507 git-index/tests/fixtures/generated-archives/V2_empty.tar.xz | |
| 210 | +100644 blob 6f22567cdd33e5af04eaf6534b59c02e23fb91bd git-index/tests/fixtures/generated-archives/v2.tar.xz | |
| 211 | +100644 blob 902ebe2e2e9012d5d0f838bcd1ceaa3cc31e18f0 git-index/tests/fixtures/generated-archives/v2_more_files.tar.xz | |
| 212 | +100644 blob 53973a1923b39bbae435a9ebd10d37eee4521281 git-index/tests/fixtures/generated-archives/v2_split_index.tar.xz | |
| 213 | +100644 blob c0f22de0620e424ef44393745b35368ad0164851 git-index/tests/fixtures/generated-archives/v4_more_files_IEOT.tar.xz | |
| 214 | +100644 blob ec8c20111ec1ebbad5654ff9c7c9ac1f3f138e52 git-index/tests/fixtures/loose_index/FSMN.git-index | |
| 215 | +100644 blob 5aa997c6f8cf6660cbe7108654e1d495301e890b git-index/tests/fixtures/loose_index/REUC.git-index | |
| 216 | +100644 blob d77985692ab14f02c70c3472b58d0cfd60c145ca git-index/tests/fixtures/loose_index/REUC.on-90d242d36e248acfae0033274b524bfa55a947fd.git-patch | |
| 217 | +100644 blob b36ae38974754043ee46f7ca3d6b55fb977e9125 git-index/tests/fixtures/loose_index/UNTR-with-oids.git-index | |
| 218 | +100644 blob 410996317bfadd1cec7229be65887b25342a6136 git-index/tests/fixtures/loose_index/UNTR-with-oids.on-90d242d36e248acfae0033274b524bfa55a947fd.git-patch | |
| 219 | +100644 blob e5d1c3cba599ef1e1347f43283fa3991382a66c3 git-index/tests/fixtures/loose_index/UNTR.git-index | |
| 220 | +100644 blob 0e253a5955f2ec02b4764002d008db426ba15e1b git-index/tests/fixtures/loose_index/conflicting-file.git-index | |
| 221 | +100644 blob f03713b684711d4a5aedab0bafd6b254137c9e5d git-index/tests/fixtures/loose_index/extended-flags.git-index | |
| 222 | +100644 blob f2c7d2ab253a69e8c693f58b72e84d1145bbdf90 git-index/tests/fixtures/loose_index/very-long-path.git-index | |
| 223 | +100644 blob 1eb48b72b8c15924c86e21da4bccd48d80e7e3fc git-index/tests/fixtures/make_index/V2_empty.sh | |
| 224 | +100644 blob a61c9527d01147eaddb846aa3e266e9b00cfa3e3 git-index/tests/fixtures/make_index/v2.sh | |
| 225 | +100644 blob d4cafddc09766f8b75d10bc45a41ffb60a40054a git-index/tests/fixtures/make_index/v2_more_files.sh | |
| 226 | +100644 blob 0b5c98e5ed863df3c001ec4634e2baabc4ba5d39 git-index/tests/fixtures/make_index/v2_split_index.sh | |
| 227 | +100644 blob 3b22aaa66924d970117f6148ccf5a5cdf0c52121 git-index/tests/fixtures/make_index/v4_more_files_IEOT.sh | |
| 228 | +100644 blob 936bcb7f42836f75d96b57045786a2d48b9a4c56 git-index/tests/index-multi-threaded.rs | |
| 229 | +100644 blob 4dcec528c1e96ccac6f98458619ba403bac1af97 git-index/tests/index-single-threaded.rs | |
| 230 | +100644 blob 6f83a5d9535564439afe91547562083f94e23885 git-index/tests/index/file/access.rs | |
| 231 | +100644 blob d7d956584364125b9e6a07b02a20c45ff22ee396 git-index/tests/index/file/mod.rs | |
| 232 | +100644 blob c8c055934ac028ebc5f9952529f9b252fec00870 git-index/tests/index/file/read.rs | |
| 233 | +100644 blob aa43428167b4598138cc1b468ffc904381042e82 git-index/tests/index/file/write.rs | |
| 234 | +100644 blob bb32d174af2d06c31aacc880ea340e0748d2aa1a git-index/tests/index/mod.rs | |
| 235 | +EOF | |
| 236 | +echo n > git-index/tests/index/file/mod.rs | |
| 237 | +git add . && git commit -m "r1-change" | |
| 238 | +store_tree "r1-change" | |
| 239 | + | |
| 240 | +rm -Rf ./* | |
| 241 | +# from d7ad650d3~1 of `gitoxide` | |
| 242 | +while read -r _ _ _ path; do | |
| 243 | + mkdir -p ${path%/*} && touch $path | |
| 244 | +done <<EOF | |
| 245 | +100644 blob 4ecbcfe3b44969cd567f3514d84248d734acd6a3 git-revision/tests/spec/parse/navigate/colon_symbol.rs | |
| 246 | +100644 blob 5bab15914e09a595f9debbad8fa6b86b020c49c8 git-revision/tests/spec/parse/navigate/mod.rs | |
| 247 | +100644 blob 5f30877b015559fbb8d5058fcb005c43c49d3049 git-revision/tests/spec/parse/navigate/tilde_symbol.rs | |
| 248 | +100644 blob 2f5046508dafd8c25fe245c1314ee0cbf3e84788 git-sec/CHANGELOG.md | |
| 249 | +100644 blob 032d318537b0b8903d386b799be700261fc4ab41 git-sec/Cargo.toml | |
| 250 | +100644 blob 7c3df38bdd204a62929492f6afb66d647737f612 git-sec/src/identity.rs | |
| 251 | +100644 blob 2f35d98cf7f363873ae93efb40df349f62b8e295 git-sec/src/lib.rs | |
| 252 | +100644 blob 5bd5f2c325f64dadf313cae344fe8973dc2a5952 git-sec/src/permission.rs | |
| 253 | +100644 blob 274c5b7807d807c04b9a702944d436ad9d3b2a35 git-sec/src/trust.rs | |
| 254 | +100644 blob da0fef3bf49d4fc0381479850eafef2ed107ce53 git-sec/tests/identity/mod.rs | |
| 255 | +100644 blob ce9c24122ab3303b9a8cd08fbc4de4fa1e65c6a9 git-sec/tests/sec.rs | |
| 256 | +100644 blob 979de34893206c26034b0ef370e40b9241f6f376 git-sequencer/CHANGELOG.md | |
| 257 | +100644 blob 65279fd869b49ba69157a3caf5d3c8ea17f557a7 git-sequencer/Cargo.toml | |
| 258 | +100644 blob 3a6cd994a5363fa97f600b539de71bb8b5191bf1 git-sequencer/src/lib.rs | |
| 259 | +100644 blob cc220fcac635129c05bdd6b23f57ef1f3ef1650a git-submodule/CHANGELOG.md | |
| 260 | +100644 blob a198ab48930dd9d0e7fc39abb36131167314c6b9 git-submodule/Cargo.toml | |
| 261 | +100644 blob 3a6cd994a5363fa97f600b539de71bb8b5191bf1 git-submodule/src/lib.rs | |
| 262 | +100644 blob 4a0c6e1d835e155a0652a0b536af0c9aa0cf9741 git-tempfile/CHANGELOG.md | |
| 263 | +100644 blob 3aecbefa04a091629de00dae370b83c0fe7de676 git-tempfile/Cargo.toml | |
| 264 | +120000 blob 965b606f331b51d566b46025f9ff311a7aad0c12 git-tempfile/LICENSE-APACHE | |
| 265 | +120000 blob 76219eb72e8524f15c21ec93b9b2592da49b5460 git-tempfile/LICENSE-MIT | |
| 266 | +100644 blob 0de38724b9f3660894cec1ba177f84539238ffb9 git-tempfile/README.md | |
| 267 | +100644 blob aae9e27984c1ae02d906949b0a1e386d3a731073 git-tempfile/examples/delete-tempfiles-on-sigterm-interactive.rs | |
| 268 | +100644 blob d51692756498b7b683c3a69e80cec9f291be35f6 git-tempfile/examples/delete-tempfiles-on-sigterm.rs | |
| 269 | +100644 blob 55550a7188e2085d82bb28bab4add362a57e5c90 git-tempfile/examples/try-deadlock-on-cleanup.rs | |
| 270 | +100644 blob 804db1ed63448af8157aff2c80bf56e1a84b152c git-tempfile/src/forksafe.rs | |
| 271 | +100644 blob 65efdb2b8892e437e9f67ad7b4e22ee2f50db19a git-tempfile/src/fs/create_dir.rs | |
| 272 | +100644 blob bf26d819b88c598769f011b76277c7cb2fcbd275 git-tempfile/src/fs/mod.rs | |
| 273 | +100644 blob ac7b212fadd4df8bebae73bfd426f5234ab84510 git-tempfile/src/fs/remove_dir.rs | |
| 274 | +100644 blob df857107439c348e73c3e3e63575027cb024d15a git-tempfile/src/handle.rs | |
| 275 | +100644 blob 7b17b144ad21ef64d142f99f6c68c7fb10b949cb git-tempfile/src/handler.rs | |
| 276 | +100644 blob f33c6c8946766315c233e8e3af590a9d7c9be47e git-tempfile/src/lib.rs | |
| 277 | +100644 blob 6332850b3aa1c3c57adad12e972d345da21a3800 git-tempfile/tests/all.rs | |
| 278 | +100644 blob d8f68872fcfa3ec20a1594c62f8a238124f14084 git-tempfile/tests/tempfile/fs/create_dir.rs | |
| 279 | +100644 blob 9c028bc7ce02dbe56c5845676e98436b036ce114 git-tempfile/tests/tempfile/fs/mod.rs | |
| 280 | +100644 blob f9323604cae7993b235719ee0972cf2002a87b11 git-tempfile/tests/tempfile/fs/remove_dir.rs | |
| 281 | +100644 blob 48475baed44a5fe6dc4b6a41c15bcc27853a828a git-tempfile/tests/tempfile/handle.rs | |
| 282 | +100644 blob da91c56c66553d87d0dd4aa3a71baf6f9ccafea7 git-tempfile/tests/tempfile/mod.rs | |
| 283 | +100644 blob 1241f04e63422675b83851a1ada4e95d1b2cb76f git-tix/CHANGELOG.md | |
| 284 | +100644 blob ea9674febfdef592bb8a3ed8195117e683043523 git-tix/Cargo.toml | |
| 285 | +100644 blob 3a6cd994a5363fa97f600b539de71bb8b5191bf1 git-tix/src/lib.rs | |
| 286 | +100644 blob 731b548f114d44015e5d81747d7ee06654209555 git-transport/CHANGELOG.md | |
| 287 | +100644 blob 212fcfed31b3468c8e0c5fc21a62768512a5417d git-transport/Cargo.toml | |
| 288 | +100644 blob b66a8fafae9f781b9b38cc85e8d1b8e5602e7d5b git-transport/src/client/async_io/bufread_ext.rs | |
| 289 | +100644 blob 924a5d4962761635c9df6ceda344a993003183a7 git-transport/src/client/async_io/connect.rs | |
| 290 | +100644 blob 6cb1a500e183bdec876221c6987e776c789b9675 git-transport/src/client/async_io/mod.rs | |
| 291 | +100644 blob 127b086ef3628a61ff2bcfbe12d4cdaf8544d61b git-transport/src/client/async_io/request.rs | |
| 292 | +100644 blob ea73f5e0943f8dd56407bd7317b80bae2888ebb3 git-transport/src/client/async_io/traits.rs | |
| 293 | +100644 blob b994b7ab504da613a2259992b41de4aef3e3969f git-transport/src/client/blocking_io/bufread_ext.rs | |
| 294 | +100644 blob 8ed6cd5c03c6a0a464f0f427afb271a0d224e65e git-transport/src/client/blocking_io/connect.rs | |
| 295 | +100644 blob 1a20cd6fadeca100793dc2522768cd3ad32cb54b git-transport/src/client/blocking_io/file.rs | |
| 296 | +100644 blob 3312aa6b9c0193a596b3db2fc909e2261f66e2dc git-transport/src/client/blocking_io/http/curl/mod.rs | |
| 297 | +100644 blob e5635d28a0c37d8b27dab21815a63235b8d94f92 git-transport/src/client/blocking_io/http/curl/remote.rs | |
| 298 | +100644 blob e5ef33d6e8cfa4597adad8ac4bcbb5ee55299a2a git-transport/src/client/blocking_io/http/mod.rs | |
| 299 | +100644 blob f429961e0da151664349a455807cdaf6e1727ebe git-transport/src/client/blocking_io/http/redirect.rs | |
| 300 | +100644 blob 7c68b166ea2f9ec69eba3d41b7bce4365b048b40 git-transport/src/client/blocking_io/http/reqwest/mod.rs | |
| 301 | +100644 blob e24d86dc20b91e8cca00de823edd9262378ae0d2 git-transport/src/client/blocking_io/http/reqwest/remote.rs | |
| 302 | +100644 blob 5b163f892a1ab4e03381fbe6d80eae199e192f05 git-transport/src/client/blocking_io/http/traits.rs | |
| 303 | +100644 blob dfb3752af95f81d12212c3bf7ca6a47f7c67a3e5 git-transport/src/client/blocking_io/mod.rs | |
| 304 | +100644 blob a1104b95a1361db0ede4eeea387d9715ff46c8ba git-transport/src/client/blocking_io/request.rs | |
| 305 | +100644 blob 97ba4c192f7be204162e13149aa7f52cd6228c64 git-transport/src/client/blocking_io/ssh/mod.rs | |
| 306 | +100644 blob 9d0be16de08b6aafb16596f507cb1d7a3990b7c1 git-transport/src/client/blocking_io/ssh/program_kind.rs | |
| 307 | +100644 blob 971d95992293f22a45128b77d9c7281d8ccff753 git-transport/src/client/blocking_io/ssh/tests.rs | |
| 308 | +100644 blob 7b2eaebbe198e8209ca4566ffb00c22dd79f95ed git-transport/src/client/blocking_io/traits.rs | |
| 309 | +100644 blob 3c1cbec7e7d0fd9a8ed5ea113f2efd7b2b0b720e git-transport/src/client/capabilities.rs | |
| 310 | +100644 blob 704a3458763dea46b16c6c12175422394e2ce533 git-transport/src/client/git/async_io.rs | |
| 311 | +100644 blob e49fe9315a3d6eec9a937890d188edfcd7199674 git-transport/src/client/git/blocking_io.rs | |
| 312 | +100644 blob 3684f00873cdf82e1691d14927a8f0130c3d4b0d git-transport/src/client/git/mod.rs | |
| 313 | +100644 blob 0eeb6f145d6b139d6c081e4ec2751905b6e046ba git-transport/src/client/mod.rs | |
| 314 | +100644 blob c60f733e584a4c201646d08114527ea00e6a3f91 git-transport/src/client/non_io_types.rs | |
| 315 | +100644 blob 9d036cb4bfbdbc2f2b07a40c171cf983f483deb8 git-transport/src/client/traits.rs | |
| 316 | +100644 blob f87864f08145adcc33c5a10c29f76360d2f0fee6 git-transport/src/lib.rs | |
| 317 | +100644 blob 19a22801885d18067c3dab22c0017fff935bb1b1 git-transport/tests/async-transport.rs | |
| 318 | +100644 blob af94be7e9f4b861f68961f5c9fe4398401c02222 git-transport/tests/blocking-transport-http.rs | |
| 319 | +100644 blob ab5365afddece55200f8a30aed22f20f7b95fe49 git-transport/tests/blocking-transport.rs | |
| 320 | +100644 blob 5bbf6291ac7000e27a5062d26994a1138153c33b git-transport/tests/client/blocking_io/http/mock.rs | |
| 321 | +100644 blob cd3b97cac1c93cc79129ce3cfb8b1657cfd210e5 git-transport/tests/client/blocking_io/http/mod.rs | |
| 322 | +100644 blob 57861695c5989af3de46ffa0c56d34d09b391ba0 git-transport/tests/client/blocking_io/mod.rs | |
| 323 | +100644 blob 5d300d1218ddf868ce51f3c6d8ecc05313e8edf4 git-transport/tests/client/capabilities.rs | |
| 324 | +100644 blob 4abab468654e94c2f4ce95c7d480ac03bd722548 git-transport/tests/client/git.rs | |
| 325 | +100644 blob 15ff276eadfd7a3b87de12a45ef4a457bb609a72 git-transport/tests/client/mod.rs | |
| 326 | +100644 blob f08593978612021a361886b8879cbcb3f539c9d2 git-transport/tests/fixtures/http-401.response | |
| 327 | +100644 blob 1d0780739288b899dd5f47b4db7fb746923fecb9 git-transport/tests/fixtures/http-404.response | |
| 328 | +100644 blob 0d38823e2a52050d61e6554a681e8e3b6b4b8e25 git-transport/tests/fixtures/http-500.response | |
| 329 | +100644 blob 9aeadfcc5622bc6c5b809381e8766ab920c97865 git-transport/tests/fixtures/v1/clone.request | |
| 330 | +100644 blob 014bd57aa08e26321886ee8b40edab4aaa6b491c git-transport/tests/fixtures/v1/clone.response | |
| 331 | +100644 blob 07375e3ca2e41e77ca471f9e20747073bc32d9e4 git-transport/tests/fixtures/v1/http-clone.response | |
| 332 | +100644 blob 4b1d110410e779fc0c9b9d91fe22d437827c5a8f git-transport/tests/fixtures/v1/http-handshake.response | |
| 333 | +100644 blob 20808368a49141542388c878e12e8bfdd3776b82 git-transport/tests/fixtures/v1/push.request | |
| 334 | +100644 blob 3a156d3f84e8bf501095ed4769287e4c87f25b55 git-transport/tests/fixtures/v1/push.response | |
| 335 | +100644 blob c68f30ff4a3fbff6f0876a9d45484dd1db7a476b git-transport/tests/fixtures/v2/clone.request | |
| 336 | +100644 blob e536d55553f47218ba5d4380772b4d8a4e3d53cc git-transport/tests/fixtures/v2/clone.response | |
| 337 | +100644 blob e5f36bd7cc9c0eb49fd076d7352dfd376bb8f4d2 git-transport/tests/fixtures/v2/http-fetch.response | |
| 338 | +100644 blob f22e506aba79247115f327925ac1eb4ddd5fc636 git-transport/tests/fixtures/v2/http-handshake-lowercase-headers.response | |
| 339 | +100644 blob 95fec47eaad1ae1dedc79d7998ea23eaf7c4fd4e git-transport/tests/fixtures/v2/http-handshake-service-announced.response | |
| 340 | +100644 blob ebb41785d75decc4672b4b06857a42cafef5e2ad git-transport/tests/fixtures/v2/http-handshake.response | |
| 341 | +100644 blob a11151fdc01f0289bcab9d29ac85e2199f2c57cb git-transport/tests/fixtures/v2/http-lsrefs.response | |
| 342 | +100644 blob 745e1ea988fbde9e4697ad9f0907dc6272d95d4a git-transport/tests/fixtures/v2/http-no-newlines-handshake.response | |
| 343 | +100644 blob e9b9992cd46fe7e9c6e521b2e899bacccf5e6ed0 git-traverse/CHANGELOG.md | |
| 344 | +100644 blob a2458e7754fba49133ce2f080c88750ee101d072 git-traverse/Cargo.toml | |
| 345 | +100644 blob de5a67e23048d15c2869ee4f7a9e7b62f12a7807 git-traverse/src/commit.rs | |
| 346 | +100644 blob 3cf6d2b3af7aa85b4bb24871ad86f473871d273c git-traverse/src/lib.rs | |
| 347 | +100644 blob b8891b7e37151749b93e9d291d60d3af3c5e03df git-traverse/src/tree/breadthfirst.rs | |
| 348 | +100644 blob ae5354198d92a8c454055c725e43af35827d09b8 git-traverse/src/tree/mod.rs | |
| 349 | +100644 blob e8e8705f8e9711786d4dbc465ff7820de0e7cc2f git-traverse/src/tree/recorder.rs | |
| 350 | +100644 blob 1bee4f196e838c49996c87a503f0cd6898ec0c9c git-traverse/tests/Cargo.toml | |
| 351 | +100644 blob 5bf10916b172794a750ffab0249bd9033cc5a10a git-traverse/tests/commit/mod.rs | |
| 352 | +100644 blob 3b3aa46d92867e38deff18a997b6d74bdebd5489 git-traverse/tests/fixtures/generated-archives/make_traversal_repo_for_commits.tar.xz | |
| 353 | +100644 blob 36ed2e1aaad3dab8335a3ec94ffc0321130605eb git-traverse/tests/fixtures/generated-archives/make_traversal_repo_for_commits_with_dates.tar.xz | |
| 354 | +100644 blob 47eb88b0ff8a58a708d4373093837409910ef758 git-traverse/tests/fixtures/generated-archives/make_traversal_repo_for_trees.tar.xz | |
| 355 | +100755 blob fe7d265f0d35eae336a46101ef250e7b695b5dce git-traverse/tests/fixtures/make_traversal_repo_for_commits.sh | |
| 356 | +100755 blob bb557a416c02d80d008fec9152752ecc2fb49d18 git-traverse/tests/fixtures/make_traversal_repo_for_commits_with_dates.sh | |
| 357 | +100755 blob 263ecf27f4779cb82fff799886d6d49c5f4f57bd git-traverse/tests/fixtures/make_traversal_repo_for_trees.sh | |
| 358 | +100644 blob 5a61dde6515ed21f08d4c205b6327904625032bf git-traverse/tests/traverse.rs | |
| 359 | +100644 blob 8dfee12de23c3ed2981b71d38a2221bb8b53acf1 git-traverse/tests/tree/mod.rs | |
| 360 | +100644 blob 8beaedfa8297379abc5653c30443e6b0036d6467 git-tui/Cargo.toml | |
| 361 | +100644 blob 86aec11b1489b268ba26bc74bb033b3994b16b14 git-tui/src/main.rs | |
| 362 | +100644 blob 5412dc380c46e86b99e3383a74173e886c877851 git-url/CHANGELOG.md | |
| 363 | +100644 blob e775ca4c301440f1aa1d08fe63142f3a108f4d9f git-url/Cargo.toml | |
| 364 | +100644 blob 393ce9116c66098c4c86498c6bef14ae001a0c77 git-url/src/expand_path.rs | |
| 365 | +100644 blob d3c5780888799ed5fb321f709ef933f9bf1b759d git-url/src/impls.rs | |
| 366 | +100644 blob 9e3de2b79aa937dc2429a03727de95a239fa576c git-url/src/lib.rs | |
| 367 | +100644 blob 0878d954b1828cf76d1c74e3cea793f78bd1e3fe git-url/src/parse.rs | |
| 368 | +100644 blob 5f491596af2d941b80c3f19900901a7d018f16fd git-url/src/scheme.rs | |
| 369 | +100644 blob 58e83d9fb13bd87eee342279becad7d91e1c2f70 git-url/tests/access/mod.rs | |
| 370 | +100644 blob a93db8f2f0e6060615f750a5e2c3d161a7e37a75 git-url/tests/expand_path/mod.rs | |
| 371 | +100644 blob 082e0ef07a1e1c22e29e394723c64a2177a96ac1 git-url/tests/parse/file.rs | |
| 372 | +100644 blob b6190d9c49b03296aa5a7bb79c42be7245b41f31 git-url/tests/parse/invalid.rs | |
| 373 | +100644 blob 19f09c2ab9b9639de9df8e1749c1182b41fa6599 git-url/tests/parse/mod.rs | |
| 374 | +100644 blob 06001013994885422734a988447191a6682f37f6 git-url/tests/parse/ssh.rs | |
| 375 | +100644 blob 9efd0163648a9f5b994712c1712b5f6b101bff31 git-url/tests/url.rs | |
| 376 | +100644 blob 89cde36ac39547728f2a59cad8cd1cb06dcd2223 git-validate/CHANGELOG.md | |
| 377 | +100644 blob 9e7ea8dedb5e5cc72281b7b77cc0b4e7ec1c7638 git-validate/Cargo.toml | |
| 378 | +100644 blob fd603aeb8b8fadf9d651725f2e16aa86bd90b7e3 git-validate/src/lib.rs | |
| 379 | +100644 blob eb1f25a812d67915889536a678a9979696f37af1 git-validate/src/reference.rs | |
| 380 | +100644 blob 91ceec18549240d3cecf3a5482c72582bca3a435 git-validate/src/tag.rs | |
| 381 | +100644 blob 1b0bdf8378ba1127e3489ac4c6b0b70e5040e1ee git-validate/tests/all.rs | |
| 382 | +100644 blob a75d2a0768a9602da34c548b1538c13bc9bdc467 git-validate/tests/validate/mod.rs | |
| 383 | +100644 blob 620572b12ea6ec39db393008604fd3b6886ef727 git-validate/tests/validate/reference.rs | |
| 384 | +100644 blob 5523e2f2181cc660104b9d8cb142781f05b42291 git-validate/tests/validate/tagname.rs | |
| 385 | +100644 blob 2ff545f32f928c5d337fdd390916e6703514f6e9 git-worktree/CHANGELOG.md | |
| 386 | +100644 blob 909c43ab0aa8369b8b47f8c7887ae71e5cbc899a git-worktree/Cargo.toml | |
| 387 | +100644 blob b75ceb753dfb0bf8d4e45e97e62ae064197b4262 git-worktree/src/fs/cache/mod.rs | |
| 388 | +100644 blob 448464345cebca4e65b42ba7908f7d37fed9b7c2 git-worktree/src/fs/cache/platform.rs | |
| 389 | +100644 blob 30c8fa04eb24e36025840da379c226e9e840473f git-worktree/src/fs/cache/state.rs | |
| 390 | +100644 blob 64daab9cea33b85d43d423f10b8fd3bde4fd219a git-worktree/src/fs/capabilities.rs | |
| 391 | +100644 blob 2f0ac0f8f59be33ee8c8db406d54f9919be01874 git-worktree/src/fs/mod.rs | |
| 392 | +100644 blob 734a4988b40c873bdf63a7dd257617410f9d5d5b git-worktree/src/fs/stack.rs | |
| 393 | +100644 blob 6f094777896d8cea62a9ca84c4fd463f3c0f57ad git-worktree/src/index/checkout.rs | |
| 394 | +100644 blob 924f127a4b20b345d58cc09b60245263176c965a git-worktree/src/index/entry.rs | |
| 395 | +100644 blob def2655345fa7e614aef38241d070272d11d7eda git-worktree/src/index/mod.rs | |
| 396 | +100644 blob 9a67e0289ee850c72494771581402861ceee51fa git-worktree/src/lib.rs | |
| 397 | +100644 blob a297e73cd876c9e91f9f7c634c95b6b4245e72a2 git-worktree/src/os.rs | |
| 398 | +100644 blob 16fa0a5d7c6e5b8f3b1fa9c0a91b615be94b29f7 git-worktree/tests/fixtures/generated-archives/make_dangerous_symlink.tar.xz | |
| 399 | +100644 blob 2eb265bd062868382f00c57576aff23d19682c9b git-worktree/tests/fixtures/generated-archives/make_ignore_and_attributes_setup.tar.xz | |
| 400 | +100644 blob 970248cf7c4ba6379ae823d1cf7e644569de445b git-worktree/tests/fixtures/generated-archives/make_ignorecase_collisions.tar.xz | |
| 401 | +100644 blob b9fd4d7e33e9b16b60563c65ca6fd16700cf26ef git-worktree/tests/fixtures/generated-archives/make_mixed_without_submodules.tar.xz | |
| 402 | +100644 blob 56edd71ff4a6ba564f271dfea79e693afd3fdccd git-worktree/tests/fixtures/generated-archives/make_special_exclude_case.tar.xz | |
| 403 | +100644 blob 31437285a37a396243633014ce41774fd54f8e5e git-worktree/tests/fixtures/make_dangerous_symlink.sh | |
| 404 | +100644 blob e176e6c8140a4c838c06830403b7ab951d54022d git-worktree/tests/fixtures/make_ignore_and_attributes_setup.sh | |
| 405 | +100644 blob c06d3926429b14ee8743a41372e3eb3c9fe386ef git-worktree/tests/fixtures/make_ignore_setup.sh | |
| 406 | +100644 blob 4a20f2080c575a15118e728f5ba3c86b339276fd git-worktree/tests/fixtures/make_ignorecase_collisions.sh | |
| 407 | +100755 blob 618c60ca54bf2dc1fbef1500454adfe481908698 git-worktree/tests/fixtures/make_mixed_without_submodules.sh | |
| 408 | +100644 blob 17a279eda9d6836d30d7d3fbd3cb64cf55876305 git-worktree/tests/fixtures/make_special_exclude_case.sh | |
| 409 | +100644 blob cdae7eb15e4ca0b89e2a80b3ebfd0bf1c50de126 git-worktree/tests/worktree-multi-threaded.rs | |
| 410 | +100644 blob 39b8dea85bec01b546bea47ef5a7ea33d8ef00eb git-worktree/tests/worktree-single-threaded.rs | |
| 411 | +100644 blob 434e6efa34c2537d55b1881ae707a0e938a32ade git-worktree/tests/worktree/fs/cache/create_directory.rs | |
| 412 | +100644 blob 896bca3cea0f9326cf15c3f3c2647d15c04477cc git-worktree/tests/worktree/fs/cache/ignore_and_attributes.rs | |
| 413 | +100644 blob ed8b4a222657b64f7037ced269163d69c233d923 git-worktree/tests/worktree/fs/cache/mod.rs | |
| 414 | +100644 blob 65064b1a507d5443fe66163069aea598a11063b8 git-worktree/tests/worktree/fs/mod.rs | |
| 415 | +100644 blob 41e3406ceadaea3ce05e65717b1abd2844bbf6d8 git-worktree/tests/worktree/fs/stack/mod.rs | |
| 416 | +100644 blob 829b0f59698439edb20aeaf6d21030e436445208 git-worktree/tests/worktree/index/checkout.rs | |
| 417 | +100644 blob 24370dce48a9b09f6c376c518c2fcd11a737c804 git-worktree/tests/worktree/index/mod.rs | |
| 418 | +100644 blob bc68cc4be7b6ad76450839eeac9d55327985b759 git-worktree/tests/worktree/mod.rs | |
| 419 | +100644 blob 7197952e50aa77dead829d931c5803bc29367a06 gitoxide-core/CHANGELOG.md | |
| 420 | +100644 blob ce87494673145fcef3dbf5509269b50fec71429e gitoxide-core/Cargo.toml | |
| 421 | +100644 blob a8118c56ae71a93cf7f09c7883d4ff16c7d51cef gitoxide-core/src/commitgraph/mod.rs | |
| 422 | +100644 blob e79e502d43fdc4177e34588d912c49a7a9991d3b gitoxide-core/src/commitgraph/verify.rs | |
| 423 | +100644 blob f33c28b5b8a9e2958204d26530a74ac3a90f8c1e gitoxide-core/src/hours/core.rs | |
| 424 | +100644 blob 38258de0f8212f8a3a09cc019246cabe87c3e812 gitoxide-core/src/hours/mod.rs | |
| 425 | +100644 blob 5738efd8ac3c5ba7e7055773ed6d195e5a2eee00 gitoxide-core/src/hours/util.rs | |
| 426 | +100644 blob 0bccdf127bfd807e6bffbef6e815561519b67c78 gitoxide-core/src/index/checkout.rs | |
| 427 | +100644 blob e6ca66aee51c3f06fc333a0920bff7b771151b1f gitoxide-core/src/index/entries.rs | |
| 428 | +100644 blob d1e543608d1c8fda88d91d3b43095fd2e084e73f gitoxide-core/src/index/information.rs | |
| 429 | +100644 blob c8556e6e01f6197036e16640cce6e975d04dff01 gitoxide-core/src/index/mod.rs | |
| 430 | +100644 blob 0d8dac5a892c89fc68ece3bce9e0ca504dce1c82 gitoxide-core/src/lib.rs | |
| 431 | +100644 blob 85c1e51c96a7df2d1121027ad1af862ed995e148 gitoxide-core/src/mailmap.rs | |
| 432 | +100644 blob 86455dd671297fc59d057df81762205990476c5f gitoxide-core/src/net.rs | |
| 433 | +100644 blob c58aca146c94ea9b47fc8ae562a220f26c59706d gitoxide-core/src/organize.rs | |
| 434 | +100644 blob 098cca5df58e13837fc3f4240906629d7b2682c2 gitoxide-core/src/pack/create.rs | |
| 435 | +100644 blob ae9aa972a45fd08d73e025ee1956bc67f2ae56a9 gitoxide-core/src/pack/explode.rs | |
| 436 | +100644 blob aec6343380d544bb9e1ee541e9453c6ea13d9b8f gitoxide-core/src/pack/index.rs | |
| 437 | +100644 blob 0805418356cf47aaa5a477ebdad2eebb00b4f2db gitoxide-core/src/pack/mod.rs | |
| 438 | +100644 blob eb847870e9d57acdceaa205370e5d517df242ace gitoxide-core/src/pack/multi_index.rs | |
| 439 | +100644 blob fa512bba534f6aa5a17fd4516d2cfc6afcc762a8 gitoxide-core/src/pack/receive.rs | |
| 440 | +100644 blob c56afcefc389ae326d0d7b78186c7d20755ffaff gitoxide-core/src/pack/verify.rs | |
| 441 | +100644 blob 59d521b3f192bbb0e0ac5d3e1cd57ecb72b72c46 gitoxide-core/src/repository/clone.rs | |
| 442 | +100644 blob d1f4c400e9f7a321af93a4b972d6d478776d4126 gitoxide-core/src/repository/commit.rs | |
| 443 | +100644 blob efeb2c53ef8be868d69a7f8e07dd719bb6858177 gitoxide-core/src/repository/config.rs | |
| 444 | +100644 blob b9b93b9d057da76abc3ba0cc5744994025f631c7 gitoxide-core/src/repository/credential.rs | |
| 445 | +100644 blob c6f620b9ff9149b0a3ed18cccc7804849863a28a gitoxide-core/src/repository/exclude.rs | |
| 446 | +100644 blob 1b980965487d2b0edcfaad60a11709f881fccb58 gitoxide-core/src/repository/fetch.rs | |
| 447 | +100644 blob d14fca2227eeb09ff610fef995a78e02de43dea4 gitoxide-core/src/repository/index.rs | |
| 448 | +100644 blob 14531df7a6c757d7fafee05e29ab3dbf483e79c7 gitoxide-core/src/repository/mailmap.rs | |
| 449 | +100644 blob 48e3ad87d13a5206b30633bbafb8c24e0bfd822a gitoxide-core/src/repository/mod.rs | |
| 450 | +100644 blob e41d95439b438012a42d37adf39c193c0b3a2a89 gitoxide-core/src/repository/odb.rs | |
| 451 | +100644 blob 78c8acc0b86c19e04fa3a0a7a4cdc8c68fbb83c1 gitoxide-core/src/repository/remote.rs | |
| 452 | +100644 blob 05c8b2833525c4da2ac725971b9cba35cbd8d5ab gitoxide-core/src/repository/revision/explain.rs | |
| 453 | +100644 blob e87590f5d9d8bc0167f182ec56604c50675ec63e gitoxide-core/src/repository/revision/list.rs | |
| 454 | +100644 blob 5e5dda98af523783a2811cfc3c0e783948a37ca7 gitoxide-core/src/repository/revision/mod.rs | |
| 455 | +100644 blob 727b56cf4b77623ea226d2e768297d2007343d2d gitoxide-core/src/repository/revision/previous_branches.rs | |
| 456 | +100644 blob a66d6b8a914589f72a752bca7d61b86e4f11f673 gitoxide-core/src/repository/revision/resolve.rs | |
| 457 | +100644 blob cbe9b913352d3d4162e2a09232b32ea6e79e237c gitoxide-core/src/repository/tree.rs | |
| 458 | +100644 blob 3b8c2579250e628dc1b141b876f71a689ae48952 gitoxide-core/src/repository/verify.rs | |
| 459 | +100644 blob fc8f25ace4a901bf771d31dac604cdf866db3261 gix-config-value/CHANGELOG.md | |
| 460 | +100644 blob e4f4aa4a2126c83404a2eacfefb9cdfc94905aa7 gix-config-value/Cargo.toml | |
| 461 | +100644 blob 908e11a300a637d5e15ec3776dda2709d981c5e1 gix-config-value/src/boolean.rs | |
| 462 | +100644 blob 558e81a769381d971d7b1f5b42df693db5b2523b gix-config-value/src/color.rs | |
| 463 | +100644 blob 7214b76e4c82ab1b4402a9a8721bf948cc828196 gix-config-value/src/integer.rs | |
| 464 | +100644 blob 5b4f3fa76c34101c422de7a2dd61e88b0ff0279e gix-config-value/src/lib.rs | |
| 465 | +100644 blob 99ee5cf2efef1d3781393a26f59b3bfa6c89db04 gix-config-value/src/path.rs | |
| 466 | +100644 blob 239679c703d6cb5131ad664312914f8a50312581 gix-config-value/src/types.rs | |
| 467 | +100644 blob 8fe8b43f0d43b5c675574e6d763cdeb171008220 gix-config-value/tests/value/boolean.rs | |
| 468 | +100644 blob 1db7fe2e03124687ec6d754e81714d429bd14a07 gix-config-value/tests/value/color.rs | |
| 469 | +100644 blob 9de2ab1ca2a8bc7d2698794b125f2c49cd722573 gix-config-value/tests/value/integer.rs | |
| 470 | +100644 blob 13a33c9d8f6b0f7d4b0929e0863000c8871b09d4 gix-config-value/tests/value/main.rs | |
| 471 | +100644 blob 10970296dbfd77368f8428a5ca3622962f747103 gix-config-value/tests/value/path.rs | |
| 472 | +100644 blob 76f58d7a187155013b02aa11a0903de46e8af0fe gix-path/CHANGELOG.md | |
| 473 | +100644 blob 6a17963b4a7fecdfdd7d38ea0fff8ab4d3030838 gix-path/Cargo.toml | |
| 474 | +100644 blob 6a949529f588978cb5feb35ea7034c703565e062 gix-path/src/convert.rs | |
| 475 | +100644 blob 70a9bc53f0704bc3e4a14263501c71355785cfaf gix-path/src/lib.rs | |
| 476 | +100644 blob 807cb74ccf62957bb4645e7d5d0b8020e3764696 gix-path/src/realpath.rs | |
| 477 | +100644 blob ff878bde141a040d3c65b9672feb612a5bb54b9a gix-path/src/spec.rs | |
| 478 | +100644 blob 7920910d725bcdbea486e340c490c76a115dfd8c gix-path/src/util.rs | |
| 479 | +100644 blob bf67c26241b3a56c1a1fa32f5d64c2057712bd83 gix-path/tests/convert/mod.rs | |
| 480 | +100644 blob 65a8885eb5722781d01941767d4a6667b4b63c3c gix-path/tests/convert/normalize.rs | |
| 481 | +100644 blob 95ebafc5e32d846cf4c980b6a6fbd8ac84809de9 gix-path/tests/path.rs | |
| 482 | +100644 blob df5a59090d7fdcb1f91d1ef2543b5dcd84266e07 gix-path/tests/realpath/mod.rs | |
| 483 | +100644 blob 7d78de7e70bfa44cb30347204b24f228a4b5ac27 gix-path/tests/util/mod.rs | |
| 484 | +100644 blob e8a55463ab7ec43354595b236df56a3e30235691 gix/CHANGELOG.md | |
| 485 | +100644 blob 2e4f5ab099d6d05403c46714e561fd1a95c4cdc8 gix/Cargo.toml | |
| 486 | +100644 blob fb5cbf0c14bc2216e794f459a1c173061fe4980a gix/examples/clone.rs | |
| 487 | +100644 blob aad2db759084cc51206967c56ed8e4f4417ede97 gix/examples/init-repo-and-commit.rs | |
| 488 | +100644 blob e75a50beea5cb93ba49d4c95db84837db91ac953 gix/examples/interrupt-handler-allows-graceful-shutdown.rs | |
| 489 | +100644 blob fcd02a2a38e76659682a57ed3f06349aa828b921 gix/examples/reversible-interrupt-handlers.rs | |
| 490 | +100644 blob 8c41a40fcefcff7b00bec539fd012b906b8a781a gix/examples/stats.rs | |
| 491 | +EOF | |
| 492 | +git add . && git commit -m "r2-base" | |
| 493 | +store_tree "r2-base" | |
| 494 | + | |
| 495 | +rm -Rf ./* | |
| 496 | +# from d7ad650d3 of `gitoxide` | |
| 497 | +while read -r _ _ _ path; do | |
| 498 | + mkdir -p ${path%/*} && touch $path | |
| 499 | +done <<EOF | |
| 500 | +100644 blob 4ecbcfe3b44969cd567f3514d84248d734acd6a3 git-revision/tests/spec/parse/navigate/colon_symbol.rs | |
| 501 | +100644 blob 5bab15914e09a595f9debbad8fa6b86b020c49c8 git-revision/tests/spec/parse/navigate/mod.rs | |
| 502 | +100644 blob 5f30877b015559fbb8d5058fcb005c43c49d3049 git-revision/tests/spec/parse/navigate/tilde_symbol.rs | |
| 503 | +100644 blob 979de34893206c26034b0ef370e40b9241f6f376 git-sequencer/CHANGELOG.md | |
| 504 | +100644 blob 65279fd869b49ba69157a3caf5d3c8ea17f557a7 git-sequencer/Cargo.toml | |
| 505 | +100644 blob 3a6cd994a5363fa97f600b539de71bb8b5191bf1 git-sequencer/src/lib.rs | |
| 506 | +100644 blob cc220fcac635129c05bdd6b23f57ef1f3ef1650a git-submodule/CHANGELOG.md | |
| 507 | +100644 blob a198ab48930dd9d0e7fc39abb36131167314c6b9 git-submodule/Cargo.toml | |
| 508 | +100644 blob 3a6cd994a5363fa97f600b539de71bb8b5191bf1 git-submodule/src/lib.rs | |
| 509 | +100644 blob 4a0c6e1d835e155a0652a0b536af0c9aa0cf9741 git-tempfile/CHANGELOG.md | |
| 510 | +100644 blob 3aecbefa04a091629de00dae370b83c0fe7de676 git-tempfile/Cargo.toml | |
| 511 | +120000 blob 965b606f331b51d566b46025f9ff311a7aad0c12 git-tempfile/LICENSE-APACHE | |
| 512 | +120000 blob 76219eb72e8524f15c21ec93b9b2592da49b5460 git-tempfile/LICENSE-MIT | |
| 513 | +100644 blob 0de38724b9f3660894cec1ba177f84539238ffb9 git-tempfile/README.md | |
| 514 | +100644 blob aae9e27984c1ae02d906949b0a1e386d3a731073 git-tempfile/examples/delete-tempfiles-on-sigterm-interactive.rs | |
| 515 | +100644 blob d51692756498b7b683c3a69e80cec9f291be35f6 git-tempfile/examples/delete-tempfiles-on-sigterm.rs | |
| 516 | +100644 blob 55550a7188e2085d82bb28bab4add362a57e5c90 git-tempfile/examples/try-deadlock-on-cleanup.rs | |
| 517 | +100644 blob 804db1ed63448af8157aff2c80bf56e1a84b152c git-tempfile/src/forksafe.rs | |
| 518 | +100644 blob 65efdb2b8892e437e9f67ad7b4e22ee2f50db19a git-tempfile/src/fs/create_dir.rs | |
| 519 | +100644 blob bf26d819b88c598769f011b76277c7cb2fcbd275 git-tempfile/src/fs/mod.rs | |
| 520 | +100644 blob ac7b212fadd4df8bebae73bfd426f5234ab84510 git-tempfile/src/fs/remove_dir.rs | |
| 521 | +100644 blob df857107439c348e73c3e3e63575027cb024d15a git-tempfile/src/handle.rs | |
| 522 | +100644 blob 7b17b144ad21ef64d142f99f6c68c7fb10b949cb git-tempfile/src/handler.rs | |
| 523 | +100644 blob f33c6c8946766315c233e8e3af590a9d7c9be47e git-tempfile/src/lib.rs | |
| 524 | +100644 blob 6332850b3aa1c3c57adad12e972d345da21a3800 git-tempfile/tests/all.rs | |
| 525 | +100644 blob d8f68872fcfa3ec20a1594c62f8a238124f14084 git-tempfile/tests/tempfile/fs/create_dir.rs | |
| 526 | +100644 blob 9c028bc7ce02dbe56c5845676e98436b036ce114 git-tempfile/tests/tempfile/fs/mod.rs | |
| 527 | +100644 blob f9323604cae7993b235719ee0972cf2002a87b11 git-tempfile/tests/tempfile/fs/remove_dir.rs | |
| 528 | +100644 blob 48475baed44a5fe6dc4b6a41c15bcc27853a828a git-tempfile/tests/tempfile/handle.rs | |
| 529 | +100644 blob da91c56c66553d87d0dd4aa3a71baf6f9ccafea7 git-tempfile/tests/tempfile/mod.rs | |
| 530 | +100644 blob 1241f04e63422675b83851a1ada4e95d1b2cb76f git-tix/CHANGELOG.md | |
| 531 | +100644 blob ea9674febfdef592bb8a3ed8195117e683043523 git-tix/Cargo.toml | |
| 532 | +100644 blob 3a6cd994a5363fa97f600b539de71bb8b5191bf1 git-tix/src/lib.rs | |
| 533 | +100644 blob 731b548f114d44015e5d81747d7ee06654209555 git-transport/CHANGELOG.md | |
| 534 | +100644 blob 212fcfed31b3468c8e0c5fc21a62768512a5417d git-transport/Cargo.toml | |
| 535 | +100644 blob b66a8fafae9f781b9b38cc85e8d1b8e5602e7d5b git-transport/src/client/async_io/bufread_ext.rs | |
| 536 | +100644 blob 924a5d4962761635c9df6ceda344a993003183a7 git-transport/src/client/async_io/connect.rs | |
| 537 | +100644 blob 6cb1a500e183bdec876221c6987e776c789b9675 git-transport/src/client/async_io/mod.rs | |
| 538 | +100644 blob 127b086ef3628a61ff2bcfbe12d4cdaf8544d61b git-transport/src/client/async_io/request.rs | |
| 539 | +100644 blob ea73f5e0943f8dd56407bd7317b80bae2888ebb3 git-transport/src/client/async_io/traits.rs | |
| 540 | +100644 blob b994b7ab504da613a2259992b41de4aef3e3969f git-transport/src/client/blocking_io/bufread_ext.rs | |
| 541 | +100644 blob 8ed6cd5c03c6a0a464f0f427afb271a0d224e65e git-transport/src/client/blocking_io/connect.rs | |
| 542 | +100644 blob 1a20cd6fadeca100793dc2522768cd3ad32cb54b git-transport/src/client/blocking_io/file.rs | |
| 543 | +100644 blob 3312aa6b9c0193a596b3db2fc909e2261f66e2dc git-transport/src/client/blocking_io/http/curl/mod.rs | |
| 544 | +100644 blob e5635d28a0c37d8b27dab21815a63235b8d94f92 git-transport/src/client/blocking_io/http/curl/remote.rs | |
| 545 | +100644 blob e5ef33d6e8cfa4597adad8ac4bcbb5ee55299a2a git-transport/src/client/blocking_io/http/mod.rs | |
| 546 | +100644 blob f429961e0da151664349a455807cdaf6e1727ebe git-transport/src/client/blocking_io/http/redirect.rs | |
| 547 | +100644 blob 7c68b166ea2f9ec69eba3d41b7bce4365b048b40 git-transport/src/client/blocking_io/http/reqwest/mod.rs | |
| 548 | +100644 blob e24d86dc20b91e8cca00de823edd9262378ae0d2 git-transport/src/client/blocking_io/http/reqwest/remote.rs | |
| 549 | +100644 blob 5b163f892a1ab4e03381fbe6d80eae199e192f05 git-transport/src/client/blocking_io/http/traits.rs | |
| 550 | +100644 blob dfb3752af95f81d12212c3bf7ca6a47f7c67a3e5 git-transport/src/client/blocking_io/mod.rs | |
| 551 | +100644 blob a1104b95a1361db0ede4eeea387d9715ff46c8ba git-transport/src/client/blocking_io/request.rs | |
| 552 | +100644 blob 97ba4c192f7be204162e13149aa7f52cd6228c64 git-transport/src/client/blocking_io/ssh/mod.rs | |
| 553 | +100644 blob 9d0be16de08b6aafb16596f507cb1d7a3990b7c1 git-transport/src/client/blocking_io/ssh/program_kind.rs | |
| 554 | +100644 blob 971d95992293f22a45128b77d9c7281d8ccff753 git-transport/src/client/blocking_io/ssh/tests.rs | |
| 555 | +100644 blob 7b2eaebbe198e8209ca4566ffb00c22dd79f95ed git-transport/src/client/blocking_io/traits.rs | |
| 556 | +100644 blob 3c1cbec7e7d0fd9a8ed5ea113f2efd7b2b0b720e git-transport/src/client/capabilities.rs | |
| 557 | +100644 blob 704a3458763dea46b16c6c12175422394e2ce533 git-transport/src/client/git/async_io.rs | |
| 558 | +100644 blob e49fe9315a3d6eec9a937890d188edfcd7199674 git-transport/src/client/git/blocking_io.rs | |
| 559 | +100644 blob 3684f00873cdf82e1691d14927a8f0130c3d4b0d git-transport/src/client/git/mod.rs | |
| 560 | +100644 blob 0eeb6f145d6b139d6c081e4ec2751905b6e046ba git-transport/src/client/mod.rs | |
| 561 | +100644 blob c60f733e584a4c201646d08114527ea00e6a3f91 git-transport/src/client/non_io_types.rs | |
| 562 | +100644 blob 9d036cb4bfbdbc2f2b07a40c171cf983f483deb8 git-transport/src/client/traits.rs | |
| 563 | +100644 blob f87864f08145adcc33c5a10c29f76360d2f0fee6 git-transport/src/lib.rs | |
| 564 | +100644 blob 19a22801885d18067c3dab22c0017fff935bb1b1 git-transport/tests/async-transport.rs | |
| 565 | +100644 blob af94be7e9f4b861f68961f5c9fe4398401c02222 git-transport/tests/blocking-transport-http.rs | |
| 566 | +100644 blob ab5365afddece55200f8a30aed22f20f7b95fe49 git-transport/tests/blocking-transport.rs | |
| 567 | +100644 blob 5bbf6291ac7000e27a5062d26994a1138153c33b git-transport/tests/client/blocking_io/http/mock.rs | |
| 568 | +100644 blob cd3b97cac1c93cc79129ce3cfb8b1657cfd210e5 git-transport/tests/client/blocking_io/http/mod.rs | |
| 569 | +100644 blob 57861695c5989af3de46ffa0c56d34d09b391ba0 git-transport/tests/client/blocking_io/mod.rs | |
| 570 | +100644 blob 5d300d1218ddf868ce51f3c6d8ecc05313e8edf4 git-transport/tests/client/capabilities.rs | |
| 571 | +100644 blob 4abab468654e94c2f4ce95c7d480ac03bd722548 git-transport/tests/client/git.rs | |
| 572 | +100644 blob 15ff276eadfd7a3b87de12a45ef4a457bb609a72 git-transport/tests/client/mod.rs | |
| 573 | +100644 blob f08593978612021a361886b8879cbcb3f539c9d2 git-transport/tests/fixtures/http-401.response | |
| 574 | +100644 blob 1d0780739288b899dd5f47b4db7fb746923fecb9 git-transport/tests/fixtures/http-404.response | |
| 575 | +100644 blob 0d38823e2a52050d61e6554a681e8e3b6b4b8e25 git-transport/tests/fixtures/http-500.response | |
| 576 | +100644 blob 9aeadfcc5622bc6c5b809381e8766ab920c97865 git-transport/tests/fixtures/v1/clone.request | |
| 577 | +100644 blob 014bd57aa08e26321886ee8b40edab4aaa6b491c git-transport/tests/fixtures/v1/clone.response | |
| 578 | +100644 blob 07375e3ca2e41e77ca471f9e20747073bc32d9e4 git-transport/tests/fixtures/v1/http-clone.response | |
| 579 | +100644 blob 4b1d110410e779fc0c9b9d91fe22d437827c5a8f git-transport/tests/fixtures/v1/http-handshake.response | |
| 580 | +100644 blob 20808368a49141542388c878e12e8bfdd3776b82 git-transport/tests/fixtures/v1/push.request | |
| 581 | +100644 blob 3a156d3f84e8bf501095ed4769287e4c87f25b55 git-transport/tests/fixtures/v1/push.response | |
| 582 | +100644 blob c68f30ff4a3fbff6f0876a9d45484dd1db7a476b git-transport/tests/fixtures/v2/clone.request | |
| 583 | +100644 blob e536d55553f47218ba5d4380772b4d8a4e3d53cc git-transport/tests/fixtures/v2/clone.response | |
| 584 | +100644 blob e5f36bd7cc9c0eb49fd076d7352dfd376bb8f4d2 git-transport/tests/fixtures/v2/http-fetch.response | |
| 585 | +100644 blob f22e506aba79247115f327925ac1eb4ddd5fc636 git-transport/tests/fixtures/v2/http-handshake-lowercase-headers.response | |
| 586 | +100644 blob 95fec47eaad1ae1dedc79d7998ea23eaf7c4fd4e git-transport/tests/fixtures/v2/http-handshake-service-announced.response | |
| 587 | +100644 blob ebb41785d75decc4672b4b06857a42cafef5e2ad git-transport/tests/fixtures/v2/http-handshake.response | |
| 588 | +100644 blob a11151fdc01f0289bcab9d29ac85e2199f2c57cb git-transport/tests/fixtures/v2/http-lsrefs.response | |
| 589 | +100644 blob 745e1ea988fbde9e4697ad9f0907dc6272d95d4a git-transport/tests/fixtures/v2/http-no-newlines-handshake.response | |
| 590 | +100644 blob e9b9992cd46fe7e9c6e521b2e899bacccf5e6ed0 git-traverse/CHANGELOG.md | |
| 591 | +100644 blob a2458e7754fba49133ce2f080c88750ee101d072 git-traverse/Cargo.toml | |
| 592 | +100644 blob de5a67e23048d15c2869ee4f7a9e7b62f12a7807 git-traverse/src/commit.rs | |
| 593 | +100644 blob 3cf6d2b3af7aa85b4bb24871ad86f473871d273c git-traverse/src/lib.rs | |
| 594 | +100644 blob b8891b7e37151749b93e9d291d60d3af3c5e03df git-traverse/src/tree/breadthfirst.rs | |
| 595 | +100644 blob ae5354198d92a8c454055c725e43af35827d09b8 git-traverse/src/tree/mod.rs | |
| 596 | +100644 blob e8e8705f8e9711786d4dbc465ff7820de0e7cc2f git-traverse/src/tree/recorder.rs | |
| 597 | +100644 blob 1bee4f196e838c49996c87a503f0cd6898ec0c9c git-traverse/tests/Cargo.toml | |
| 598 | +100644 blob 5bf10916b172794a750ffab0249bd9033cc5a10a git-traverse/tests/commit/mod.rs | |
| 599 | +100644 blob 3b3aa46d92867e38deff18a997b6d74bdebd5489 git-traverse/tests/fixtures/generated-archives/make_traversal_repo_for_commits.tar.xz | |
| 600 | +100644 blob 36ed2e1aaad3dab8335a3ec94ffc0321130605eb git-traverse/tests/fixtures/generated-archives/make_traversal_repo_for_commits_with_dates.tar.xz | |
| 601 | +100644 blob 47eb88b0ff8a58a708d4373093837409910ef758 git-traverse/tests/fixtures/generated-archives/make_traversal_repo_for_trees.tar.xz | |
| 602 | +100755 blob fe7d265f0d35eae336a46101ef250e7b695b5dce git-traverse/tests/fixtures/make_traversal_repo_for_commits.sh | |
| 603 | +100755 blob bb557a416c02d80d008fec9152752ecc2fb49d18 git-traverse/tests/fixtures/make_traversal_repo_for_commits_with_dates.sh | |
| 604 | +100755 blob 263ecf27f4779cb82fff799886d6d49c5f4f57bd git-traverse/tests/fixtures/make_traversal_repo_for_trees.sh | |
| 605 | +100644 blob 5a61dde6515ed21f08d4c205b6327904625032bf git-traverse/tests/traverse.rs | |
| 606 | +100644 blob 8dfee12de23c3ed2981b71d38a2221bb8b53acf1 git-traverse/tests/tree/mod.rs | |
| 607 | +100644 blob 8beaedfa8297379abc5653c30443e6b0036d6467 git-tui/Cargo.toml | |
| 608 | +100644 blob 86aec11b1489b268ba26bc74bb033b3994b16b14 git-tui/src/main.rs | |
| 609 | +100644 blob 5412dc380c46e86b99e3383a74173e886c877851 git-url/CHANGELOG.md | |
| 610 | +100644 blob e775ca4c301440f1aa1d08fe63142f3a108f4d9f git-url/Cargo.toml | |
| 611 | +100644 blob 393ce9116c66098c4c86498c6bef14ae001a0c77 git-url/src/expand_path.rs | |
| 612 | +100644 blob d3c5780888799ed5fb321f709ef933f9bf1b759d git-url/src/impls.rs | |
| 613 | +100644 blob 9e3de2b79aa937dc2429a03727de95a239fa576c git-url/src/lib.rs | |
| 614 | +100644 blob 0878d954b1828cf76d1c74e3cea793f78bd1e3fe git-url/src/parse.rs | |
| 615 | +100644 blob 5f491596af2d941b80c3f19900901a7d018f16fd git-url/src/scheme.rs | |
| 616 | +100644 blob 58e83d9fb13bd87eee342279becad7d91e1c2f70 git-url/tests/access/mod.rs | |
| 617 | +100644 blob a93db8f2f0e6060615f750a5e2c3d161a7e37a75 git-url/tests/expand_path/mod.rs | |
| 618 | +100644 blob 082e0ef07a1e1c22e29e394723c64a2177a96ac1 git-url/tests/parse/file.rs | |
| 619 | +100644 blob b6190d9c49b03296aa5a7bb79c42be7245b41f31 git-url/tests/parse/invalid.rs | |
| 620 | +100644 blob 19f09c2ab9b9639de9df8e1749c1182b41fa6599 git-url/tests/parse/mod.rs | |
| 621 | +100644 blob 06001013994885422734a988447191a6682f37f6 git-url/tests/parse/ssh.rs | |
| 622 | +100644 blob 9efd0163648a9f5b994712c1712b5f6b101bff31 git-url/tests/url.rs | |
| 623 | +100644 blob 89cde36ac39547728f2a59cad8cd1cb06dcd2223 git-validate/CHANGELOG.md | |
| 624 | +100644 blob 9e7ea8dedb5e5cc72281b7b77cc0b4e7ec1c7638 git-validate/Cargo.toml | |
| 625 | +100644 blob fd603aeb8b8fadf9d651725f2e16aa86bd90b7e3 git-validate/src/lib.rs | |
| 626 | +100644 blob eb1f25a812d67915889536a678a9979696f37af1 git-validate/src/reference.rs | |
| 627 | +100644 blob 91ceec18549240d3cecf3a5482c72582bca3a435 git-validate/src/tag.rs | |
| 628 | +100644 blob 1b0bdf8378ba1127e3489ac4c6b0b70e5040e1ee git-validate/tests/all.rs | |
| 629 | +100644 blob a75d2a0768a9602da34c548b1538c13bc9bdc467 git-validate/tests/validate/mod.rs | |
| 630 | +100644 blob 620572b12ea6ec39db393008604fd3b6886ef727 git-validate/tests/validate/reference.rs | |
| 631 | +100644 blob 5523e2f2181cc660104b9d8cb142781f05b42291 git-validate/tests/validate/tagname.rs | |
| 632 | +100644 blob 2ff545f32f928c5d337fdd390916e6703514f6e9 git-worktree/CHANGELOG.md | |
| 633 | +100644 blob 909c43ab0aa8369b8b47f8c7887ae71e5cbc899a git-worktree/Cargo.toml | |
| 634 | +100644 blob b75ceb753dfb0bf8d4e45e97e62ae064197b4262 git-worktree/src/fs/cache/mod.rs | |
| 635 | +100644 blob 448464345cebca4e65b42ba7908f7d37fed9b7c2 git-worktree/src/fs/cache/platform.rs | |
| 636 | +100644 blob 30c8fa04eb24e36025840da379c226e9e840473f git-worktree/src/fs/cache/state.rs | |
| 637 | +100644 blob 64daab9cea33b85d43d423f10b8fd3bde4fd219a git-worktree/src/fs/capabilities.rs | |
| 638 | +100644 blob 2f0ac0f8f59be33ee8c8db406d54f9919be01874 git-worktree/src/fs/mod.rs | |
| 639 | +100644 blob 734a4988b40c873bdf63a7dd257617410f9d5d5b git-worktree/src/fs/stack.rs | |
| 640 | +100644 blob 6f094777896d8cea62a9ca84c4fd463f3c0f57ad git-worktree/src/index/checkout.rs | |
| 641 | +100644 blob 924f127a4b20b345d58cc09b60245263176c965a git-worktree/src/index/entry.rs | |
| 642 | +100644 blob def2655345fa7e614aef38241d070272d11d7eda git-worktree/src/index/mod.rs | |
| 643 | +100644 blob 9a67e0289ee850c72494771581402861ceee51fa git-worktree/src/lib.rs | |
| 644 | +100644 blob a297e73cd876c9e91f9f7c634c95b6b4245e72a2 git-worktree/src/os.rs | |
| 645 | +100644 blob 16fa0a5d7c6e5b8f3b1fa9c0a91b615be94b29f7 git-worktree/tests/fixtures/generated-archives/make_dangerous_symlink.tar.xz | |
| 646 | +100644 blob 2eb265bd062868382f00c57576aff23d19682c9b git-worktree/tests/fixtures/generated-archives/make_ignore_and_attributes_setup.tar.xz | |
| 647 | +100644 blob 970248cf7c4ba6379ae823d1cf7e644569de445b git-worktree/tests/fixtures/generated-archives/make_ignorecase_collisions.tar.xz | |
| 648 | +100644 blob b9fd4d7e33e9b16b60563c65ca6fd16700cf26ef git-worktree/tests/fixtures/generated-archives/make_mixed_without_submodules.tar.xz | |
| 649 | +100644 blob 56edd71ff4a6ba564f271dfea79e693afd3fdccd git-worktree/tests/fixtures/generated-archives/make_special_exclude_case.tar.xz | |
| 650 | +100644 blob 31437285a37a396243633014ce41774fd54f8e5e git-worktree/tests/fixtures/make_dangerous_symlink.sh | |
| 651 | +100644 blob e176e6c8140a4c838c06830403b7ab951d54022d git-worktree/tests/fixtures/make_ignore_and_attributes_setup.sh | |
| 652 | +100644 blob c06d3926429b14ee8743a41372e3eb3c9fe386ef git-worktree/tests/fixtures/make_ignore_setup.sh | |
| 653 | +100644 blob 4a20f2080c575a15118e728f5ba3c86b339276fd git-worktree/tests/fixtures/make_ignorecase_collisions.sh | |
| 654 | +100755 blob 618c60ca54bf2dc1fbef1500454adfe481908698 git-worktree/tests/fixtures/make_mixed_without_submodules.sh | |
| 655 | +100644 blob 17a279eda9d6836d30d7d3fbd3cb64cf55876305 git-worktree/tests/fixtures/make_special_exclude_case.sh | |
| 656 | +100644 blob cdae7eb15e4ca0b89e2a80b3ebfd0bf1c50de126 git-worktree/tests/worktree-multi-threaded.rs | |
| 657 | +100644 blob 39b8dea85bec01b546bea47ef5a7ea33d8ef00eb git-worktree/tests/worktree-single-threaded.rs | |
| 658 | +100644 blob 434e6efa34c2537d55b1881ae707a0e938a32ade git-worktree/tests/worktree/fs/cache/create_directory.rs | |
| 659 | +100644 blob 896bca3cea0f9326cf15c3f3c2647d15c04477cc git-worktree/tests/worktree/fs/cache/ignore_and_attributes.rs | |
| 660 | +100644 blob ed8b4a222657b64f7037ced269163d69c233d923 git-worktree/tests/worktree/fs/cache/mod.rs | |
| 661 | +100644 blob 65064b1a507d5443fe66163069aea598a11063b8 git-worktree/tests/worktree/fs/mod.rs | |
| 662 | +100644 blob 41e3406ceadaea3ce05e65717b1abd2844bbf6d8 git-worktree/tests/worktree/fs/stack/mod.rs | |
| 663 | +100644 blob 829b0f59698439edb20aeaf6d21030e436445208 git-worktree/tests/worktree/index/checkout.rs | |
| 664 | +100644 blob 24370dce48a9b09f6c376c518c2fcd11a737c804 git-worktree/tests/worktree/index/mod.rs | |
| 665 | +100644 blob bc68cc4be7b6ad76450839eeac9d55327985b759 git-worktree/tests/worktree/mod.rs | |
| 666 | +100644 blob 7197952e50aa77dead829d931c5803bc29367a06 gitoxide-core/CHANGELOG.md | |
| 667 | +100644 blob ce87494673145fcef3dbf5509269b50fec71429e gitoxide-core/Cargo.toml | |
| 668 | +100644 blob a8118c56ae71a93cf7f09c7883d4ff16c7d51cef gitoxide-core/src/commitgraph/mod.rs | |
| 669 | +100644 blob e79e502d43fdc4177e34588d912c49a7a9991d3b gitoxide-core/src/commitgraph/verify.rs | |
| 670 | +100644 blob f33c28b5b8a9e2958204d26530a74ac3a90f8c1e gitoxide-core/src/hours/core.rs | |
| 671 | +100644 blob 38258de0f8212f8a3a09cc019246cabe87c3e812 gitoxide-core/src/hours/mod.rs | |
| 672 | +100644 blob 5738efd8ac3c5ba7e7055773ed6d195e5a2eee00 gitoxide-core/src/hours/util.rs | |
| 673 | +100644 blob 0bccdf127bfd807e6bffbef6e815561519b67c78 gitoxide-core/src/index/checkout.rs | |
| 674 | +100644 blob e6ca66aee51c3f06fc333a0920bff7b771151b1f gitoxide-core/src/index/entries.rs | |
| 675 | +100644 blob d1e543608d1c8fda88d91d3b43095fd2e084e73f gitoxide-core/src/index/information.rs | |
| 676 | +100644 blob c8556e6e01f6197036e16640cce6e975d04dff01 gitoxide-core/src/index/mod.rs | |
| 677 | +100644 blob 0d8dac5a892c89fc68ece3bce9e0ca504dce1c82 gitoxide-core/src/lib.rs | |
| 678 | +100644 blob 85c1e51c96a7df2d1121027ad1af862ed995e148 gitoxide-core/src/mailmap.rs | |
| 679 | +100644 blob 86455dd671297fc59d057df81762205990476c5f gitoxide-core/src/net.rs | |
| 680 | +100644 blob c58aca146c94ea9b47fc8ae562a220f26c59706d gitoxide-core/src/organize.rs | |
| 681 | +100644 blob 098cca5df58e13837fc3f4240906629d7b2682c2 gitoxide-core/src/pack/create.rs | |
| 682 | +100644 blob ae9aa972a45fd08d73e025ee1956bc67f2ae56a9 gitoxide-core/src/pack/explode.rs | |
| 683 | +100644 blob aec6343380d544bb9e1ee541e9453c6ea13d9b8f gitoxide-core/src/pack/index.rs | |
| 684 | +100644 blob 0805418356cf47aaa5a477ebdad2eebb00b4f2db gitoxide-core/src/pack/mod.rs | |
| 685 | +100644 blob eb847870e9d57acdceaa205370e5d517df242ace gitoxide-core/src/pack/multi_index.rs | |
| 686 | +100644 blob fa512bba534f6aa5a17fd4516d2cfc6afcc762a8 gitoxide-core/src/pack/receive.rs | |
| 687 | +100644 blob c56afcefc389ae326d0d7b78186c7d20755ffaff gitoxide-core/src/pack/verify.rs | |
| 688 | +100644 blob 59d521b3f192bbb0e0ac5d3e1cd57ecb72b72c46 gitoxide-core/src/repository/clone.rs | |
| 689 | +100644 blob d1f4c400e9f7a321af93a4b972d6d478776d4126 gitoxide-core/src/repository/commit.rs | |
| 690 | +100644 blob efeb2c53ef8be868d69a7f8e07dd719bb6858177 gitoxide-core/src/repository/config.rs | |
| 691 | +100644 blob b9b93b9d057da76abc3ba0cc5744994025f631c7 gitoxide-core/src/repository/credential.rs | |
| 692 | +100644 blob c6f620b9ff9149b0a3ed18cccc7804849863a28a gitoxide-core/src/repository/exclude.rs | |
| 693 | +100644 blob 1b980965487d2b0edcfaad60a11709f881fccb58 gitoxide-core/src/repository/fetch.rs | |
| 694 | +100644 blob d14fca2227eeb09ff610fef995a78e02de43dea4 gitoxide-core/src/repository/index.rs | |
| 695 | +100644 blob 14531df7a6c757d7fafee05e29ab3dbf483e79c7 gitoxide-core/src/repository/mailmap.rs | |
| 696 | +100644 blob 48e3ad87d13a5206b30633bbafb8c24e0bfd822a gitoxide-core/src/repository/mod.rs | |
| 697 | +100644 blob e41d95439b438012a42d37adf39c193c0b3a2a89 gitoxide-core/src/repository/odb.rs | |
| 698 | +100644 blob 78c8acc0b86c19e04fa3a0a7a4cdc8c68fbb83c1 gitoxide-core/src/repository/remote.rs | |
| 699 | +100644 blob 05c8b2833525c4da2ac725971b9cba35cbd8d5ab gitoxide-core/src/repository/revision/explain.rs | |
| 700 | +100644 blob e87590f5d9d8bc0167f182ec56604c50675ec63e gitoxide-core/src/repository/revision/list.rs | |
| 701 | +100644 blob 5e5dda98af523783a2811cfc3c0e783948a37ca7 gitoxide-core/src/repository/revision/mod.rs | |
| 702 | +100644 blob 727b56cf4b77623ea226d2e768297d2007343d2d gitoxide-core/src/repository/revision/previous_branches.rs | |
| 703 | +100644 blob a66d6b8a914589f72a752bca7d61b86e4f11f673 gitoxide-core/src/repository/revision/resolve.rs | |
| 704 | +100644 blob cbe9b913352d3d4162e2a09232b32ea6e79e237c gitoxide-core/src/repository/tree.rs | |
| 705 | +100644 blob 3b8c2579250e628dc1b141b876f71a689ae48952 gitoxide-core/src/repository/verify.rs | |
| 706 | +100644 blob fc8f25ace4a901bf771d31dac604cdf866db3261 gix-config-value/CHANGELOG.md | |
| 707 | +100644 blob e4f4aa4a2126c83404a2eacfefb9cdfc94905aa7 gix-config-value/Cargo.toml | |
| 708 | +100644 blob 908e11a300a637d5e15ec3776dda2709d981c5e1 gix-config-value/src/boolean.rs | |
| 709 | +100644 blob 558e81a769381d971d7b1f5b42df693db5b2523b gix-config-value/src/color.rs | |
| 710 | +100644 blob 7214b76e4c82ab1b4402a9a8721bf948cc828196 gix-config-value/src/integer.rs | |
| 711 | +100644 blob 5b4f3fa76c34101c422de7a2dd61e88b0ff0279e gix-config-value/src/lib.rs | |
| 712 | +100644 blob 99ee5cf2efef1d3781393a26f59b3bfa6c89db04 gix-config-value/src/path.rs | |
| 713 | +100644 blob 239679c703d6cb5131ad664312914f8a50312581 gix-config-value/src/types.rs | |
| 714 | +100644 blob 8fe8b43f0d43b5c675574e6d763cdeb171008220 gix-config-value/tests/value/boolean.rs | |
| 715 | +100644 blob 1db7fe2e03124687ec6d754e81714d429bd14a07 gix-config-value/tests/value/color.rs | |
| 716 | +100644 blob 9de2ab1ca2a8bc7d2698794b125f2c49cd722573 gix-config-value/tests/value/integer.rs | |
| 717 | +100644 blob 13a33c9d8f6b0f7d4b0929e0863000c8871b09d4 gix-config-value/tests/value/main.rs | |
| 718 | +100644 blob 10970296dbfd77368f8428a5ca3622962f747103 gix-config-value/tests/value/path.rs | |
| 719 | +100644 blob 76f58d7a187155013b02aa11a0903de46e8af0fe gix-path/CHANGELOG.md | |
| 720 | +100644 blob 6a17963b4a7fecdfdd7d38ea0fff8ab4d3030838 gix-path/Cargo.toml | |
| 721 | +100644 blob 6a949529f588978cb5feb35ea7034c703565e062 gix-path/src/convert.rs | |
| 722 | +100644 blob 70a9bc53f0704bc3e4a14263501c71355785cfaf gix-path/src/lib.rs | |
| 723 | +100644 blob 807cb74ccf62957bb4645e7d5d0b8020e3764696 gix-path/src/realpath.rs | |
| 724 | +100644 blob ff878bde141a040d3c65b9672feb612a5bb54b9a gix-path/src/spec.rs | |
| 725 | +100644 blob 7920910d725bcdbea486e340c490c76a115dfd8c gix-path/src/util.rs | |
| 726 | +100644 blob bf67c26241b3a56c1a1fa32f5d64c2057712bd83 gix-path/tests/convert/mod.rs | |
| 727 | +100644 blob 65a8885eb5722781d01941767d4a6667b4b63c3c gix-path/tests/convert/normalize.rs | |
| 728 | +100644 blob 95ebafc5e32d846cf4c980b6a6fbd8ac84809de9 gix-path/tests/path.rs | |
| 729 | +100644 blob df5a59090d7fdcb1f91d1ef2543b5dcd84266e07 gix-path/tests/realpath/mod.rs | |
| 730 | +100644 blob 7d78de7e70bfa44cb30347204b24f228a4b5ac27 gix-path/tests/util/mod.rs | |
| 731 | +100644 blob 2f5046508dafd8c25fe245c1314ee0cbf3e84788 gix-sec/CHANGELOG.md | |
| 732 | +100644 blob 032d318537b0b8903d386b799be700261fc4ab41 gix-sec/Cargo.toml | |
| 733 | +100644 blob 7c3df38bdd204a62929492f6afb66d647737f612 gix-sec/src/identity.rs | |
| 734 | +100644 blob 2f35d98cf7f363873ae93efb40df349f62b8e295 gix-sec/src/lib.rs | |
| 735 | +100644 blob 5bd5f2c325f64dadf313cae344fe8973dc2a5952 gix-sec/src/permission.rs | |
| 736 | +100644 blob 274c5b7807d807c04b9a702944d436ad9d3b2a35 gix-sec/src/trust.rs | |
| 737 | +100644 blob da0fef3bf49d4fc0381479850eafef2ed107ce53 gix-sec/tests/identity/mod.rs | |
| 738 | +100644 blob ce9c24122ab3303b9a8cd08fbc4de4fa1e65c6a9 gix-sec/tests/sec.rs | |
| 739 | +100644 blob e8a55463ab7ec43354595b236df56a3e30235691 gix/CHANGELOG.md | |
| 740 | +100644 blob 2e4f5ab099d6d05403c46714e561fd1a95c4cdc8 gix/Cargo.toml | |
| 741 | +100644 blob fb5cbf0c14bc2216e794f459a1c173061fe4980a gix/examples/clone.rs | |
| 742 | +100644 blob aad2db759084cc51206967c56ed8e4f4417ede97 gix/examples/init-repo-and-commit.rs | |
| 743 | +100644 blob e75a50beea5cb93ba49d4c95db84837db91ac953 gix/examples/interrupt-handler-allows-graceful-shutdown.rs | |
| 744 | +100644 blob fcd02a2a38e76659682a57ed3f06349aa828b921 gix/examples/reversible-interrupt-handlers.rs | |
| 745 | +100644 blob 8c41a40fcefcff7b00bec539fd012b906b8a781a gix/examples/stats.rs | |
| 746 | +EOF | |
| 747 | +git add . && git commit -m "r2-change" | |
| 748 | +store_tree "r2-change" | |
| 749 | + | |
| 750 | +rm -Rf ./* | |
| 751 | +# from faaf791cc of `gitoxide` | |
| 752 | +while read -r _ _ _ path; do | |
| 753 | + mkdir -p ${path%/*} && touch $path | |
| 754 | +done <<EOF | |
| 755 | +100644 blob 75306517965a54731b94dca8bace640e856af115 rustfmt.toml | |
| 756 | +100644 blob 653db61c27bc8676db65293799ee37b900d21cd1 src/plumbing-cli.rs | |
| 757 | +100644 blob b30a19098c101818cb46aa1730681bb439827a0a src/plumbing/main.rs | |
| 758 | +100644 blob 2e32346bdd9dd1092020cc8e8294adaa7c8019fc src/plumbing/mod.rs | |
| 759 | +100644 blob 7a0f73b3e46b1dbfe518aed268098722d26b4ce1 src/plumbing/options.rs | |
| 760 | +100644 blob 1414704becf8540873778861a10dc1d04a3cb04a src/porcelain-cli.rs | |
| 761 | +100644 blob af1c7d8b9a565a8c952b5680948a1ca689f1b267 src/porcelain/main.rs | |
| 762 | +100644 blob 68886bba05f53a7b1e4597a243a4e513092cd4db src/porcelain/mod.rs | |
| 763 | +100644 blob 9d3a25aaab6ad92ff8781655690a3421bbd1d6de src/porcelain/options.rs | |
| 764 | +100644 blob d9b5ae05af9bcb05e83b7296e11505cce7b3c9bf src/shared.rs | |
| 765 | +100644 blob 8236acaa18c95b5e1de26d6e50f54989c43c83df tasks.md | |
| 766 | +EOF | |
| 767 | +git add . && git commit -m "r3-base" | |
| 768 | +store_tree "r3-base" | |
| 769 | + | |
| 770 | +rm -Rf ./* | |
| 771 | +# from faaf791cc of `gitoxide` | |
| 772 | +while read -r _ _ _ path; do | |
| 773 | + mkdir -p ${path%/*} && touch $path | |
| 774 | +done <<EOF | |
| 775 | +100644 blob 75306517965a54731b94dca8bace640e856af115 rustfmt.toml | |
| 776 | +100644 blob 1414704becf8540873778861a10dc1d04a3cb04a src/ein.rs | |
| 777 | +100644 blob 653db61c27bc8676db65293799ee37b900d21cd1 src/gix.rs | |
| 778 | +100644 blob b30a19098c101818cb46aa1730681bb439827a0a src/plumbing/main.rs | |
| 779 | +100644 blob 2e32346bdd9dd1092020cc8e8294adaa7c8019fc src/plumbing/mod.rs | |
| 780 | +100644 blob 7a0f73b3e46b1dbfe518aed268098722d26b4ce1 src/plumbing/options.rs | |
| 781 | +100644 blob af1c7d8b9a565a8c952b5680948a1ca689f1b267 src/porcelain/main.rs | |
| 782 | +100644 blob 68886bba05f53a7b1e4597a243a4e513092cd4db src/porcelain/mod.rs | |
| 783 | +100644 blob 9d3a25aaab6ad92ff8781655690a3421bbd1d6de src/porcelain/options.rs | |
| 784 | +100644 blob d9b5ae05af9bcb05e83b7296e11505cce7b3c9bf src/shared.rs | |
| 785 | +100644 blob 8236acaa18c95b5e1de26d6e50f54989c43c83df tasks.md | |
| 786 | +EOF | |
| 787 | +git add . && git commit -m "r3-change" | |
| 788 | +store_tree "r3-change" | |
| 789 | + | |
| 790 | +git -c diff.renames=0 show > baseline-3.no-renames | |
| 791 | +git -c diff.renames=1 show > baseline-3.with-renames | |
| 792 | +git -c diff.renames=0 show HEAD~2 > baseline-2.no-renames | |
| 793 | +git -c diff.renames=1 show HEAD~2 > baseline-2.with-renames | |
| 794 | +git -c diff.renames=0 show HEAD~4 > baseline.no-renames | |
| 795 | +git -c diff.renames=1 show HEAD~4 > baseline.with-renames | |
| 796 | + | |
| 797 | +mv ../*.tree . | |