| @@ -159,34 +159,37 @@ mod changes { · 158 unmodified lines |
| 159 | 159 | fn many_different_states() -> crate::Result { |
| 160 | 160 | let db = db(None)?; |
| 161 | 161 | let all_commits = all_commits(&db); |
| 162 | | − assert_hash_agnostic_eq!( |
| 162 | + pretty_assertions::assert_eq!( |
| 163 | 163 | diff_with_previous_commit_from(&db, &all_commits["f added"])?, |
| 164 | 164 | vec![Addition { |
| 165 | 165 | entry_mode: EntryKind::Blob.into(), |
| 166 | | − oid: hex_to_id("e69de29bb2d1d6434b8b29ae775ad8c2e48c5391"), |
| 166 | + oid: hex_to_id("e69de29bb2d1d6434b8b29ae775ad8c2e48c5391", "473a0f4c3be8a93681a267e3b1e9a7dcda1185436fe141f7749120a303721813"), |
| 167 | 167 | path: "f".into(), |
| 168 | 168 | relation: None |
| 169 | 169 | }], |
| 170 | 170 | ":000000 100644 0000000000000000000000000000000000000000 e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 A f" |
| 171 | 171 | ); |
| 172 | 172 | |
| 173 | | − assert_hash_agnostic_eq!( |
| 173 | + pretty_assertions::assert_eq!( |
| 174 | 174 | diff_with_previous_commit_from(&db, &all_commits["f modified"])?, |
| 175 | 175 | vec![Modification { |
| 176 | 176 | previous_entry_mode: EntryKind::Blob.into(), |
| 177 | | − previous_oid: hex_to_id("e69de29bb2d1d6434b8b29ae775ad8c2e48c5391"), |
| 177 | + previous_oid: hex_to_id("e69de29bb2d1d6434b8b29ae775ad8c2e48c5391", "473a0f4c3be8a93681a267e3b1e9a7dcda1185436fe141f7749120a303721813"), |
| 178 | 178 | entry_mode: EntryKind::Blob.into(), |
| 179 | | − oid: hex_to_id("28ce6a8b26aa170e1de65536fe8abe1832bd3242"), |
| 179 | + oid: hex_to_id("28ce6a8b26aa170e1de65536fe8abe1832bd3242", "6ca8d4e3bc5df874055e542d18505b5a5efa0fb7d65776efedc13781073ed0f1"), |
| 180 | 180 | path: "f".into() |
| 181 | 181 | }], |
| 182 | 182 | ":100644 100644 e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 28ce6a8b26aa170e1de65536fe8abe1832bd3242 M f" |
| 183 | 183 | ); |
| 184 | 184 | |
| 185 | | − assert_hash_agnostic_eq!( |
| 185 | + pretty_assertions::assert_eq!( |
| 186 | 186 | diff_with_previous_commit_from(&db, &all_commits["f deleted"])?, |
| 187 | 187 | vec![Deletion { |
| 188 | 188 | entry_mode: EntryKind::Blob.into(), |
| 189 | | − oid: hex_to_id("28ce6a8b26aa170e1de65536fe8abe1832bd3242"), |
| 189 | + oid: hex_to_id( |
| 190 | + "28ce6a8b26aa170e1de65536fe8abe1832bd3242", |
| 191 | + "6ca8d4e3bc5df874055e542d18505b5a5efa0fb7d65776efedc13781073ed0f1" |
| 192 | + ), |
| 190 | 193 | path: "f".into(), |
| 191 | 194 | relation: None |
| 192 | 195 | }], |
| @@ -194,24 +197,24 @@ mod changes { · 1 unmodified line |
| 194 | 197 | " |
| 195 | 198 | ); |
| 196 | 199 | |
| 197 | | − assert_hash_agnostic_eq!( |
| 200 | + pretty_assertions::assert_eq!( |
| 198 | 201 | diff_with_previous_commit_from(&db, &all_commits["f mode modified to dir f/"])?, |
| 199 | 202 | vec![ |
| 200 | 203 | Deletion { |
| 201 | 204 | entry_mode: EntryKind::Blob.into(), |
| 202 | | − oid: hex_to_id("28ce6a8b26aa170e1de65536fe8abe1832bd3242"), |
| 205 | + oid: hex_to_id("28ce6a8b26aa170e1de65536fe8abe1832bd3242", "6ca8d4e3bc5df874055e542d18505b5a5efa0fb7d65776efedc13781073ed0f1"), |
| 203 | 206 | path: "f".into(), |
| 204 | 207 | relation: None |
| 205 | 208 | }, |
| 206 | 209 | Addition { |
| 207 | 210 | entry_mode: EntryKind::Tree.into(), |
| 208 | | − oid: hex_to_id("10f2f4b82222d2b5c31985130979a91fd87410f7"), |
| 211 | + oid: hex_to_id("10f2f4b82222d2b5c31985130979a91fd87410f7", "9e220e584599b9cff376b638fa71675280f4582a87138b6be425258dbb85f94c"), |
| 209 | 212 | path: "f".into(), |
| 210 | 213 | relation: Some(Relation::Parent(1)), |
| 211 | 214 | }, |
| 212 | 215 | Addition { |
| 213 | 216 | entry_mode: EntryKind::Blob.into(), |
| 214 | | − oid: hex_to_id("28ce6a8b26aa170e1de65536fe8abe1832bd3242"), |
| 217 | + oid: hex_to_id("28ce6a8b26aa170e1de65536fe8abe1832bd3242", "6ca8d4e3bc5df874055e542d18505b5a5efa0fb7d65776efedc13781073ed0f1"), |
| 215 | 218 | path: "f/f".into(), |
| 216 | 219 | relation: Some(Relation::ChildOfParent(1)), |
| 217 | 220 | } |
| @@ -220,18 +223,18 @@ mod changes { · 2 unmodified lines |
| 220 | 223 | :000000 100644 0000000000000000000000000000000000000000 28ce6a8b26aa170e1de65536fe8abe1832bd3242 A f/f" |
| 221 | 224 | ); |
| 222 | 225 | |
| 223 | | − assert_hash_agnostic_eq!( |
| 226 | + pretty_assertions::assert_eq!( |
| 224 | 227 | diff_with_previous_commit_from(&db, &all_commits["a renamed to b"])?, |
| 225 | 228 | vec![ |
| 226 | 229 | Deletion { |
| 227 | 230 | entry_mode: EntryKind::Blob.into(), |
| 228 | | − oid: hex_to_id("e69de29bb2d1d6434b8b29ae775ad8c2e48c5391"), |
| 231 | + oid: hex_to_id("e69de29bb2d1d6434b8b29ae775ad8c2e48c5391", "473a0f4c3be8a93681a267e3b1e9a7dcda1185436fe141f7749120a303721813"), |
| 229 | 232 | path: "a".into(), |
| 230 | 233 | relation: None |
| 231 | 234 | }, |
| 232 | 235 | Addition { |
| 233 | 236 | entry_mode: EntryKind::Blob.into(), |
| 234 | | − oid: hex_to_id("e69de29bb2d1d6434b8b29ae775ad8c2e48c5391"), |
| 237 | + oid: hex_to_id("e69de29bb2d1d6434b8b29ae775ad8c2e48c5391", "473a0f4c3be8a93681a267e3b1e9a7dcda1185436fe141f7749120a303721813"), |
| 235 | 238 | path: "b".into(), |
| 236 | 239 | relation: None |
| 237 | 240 | } |
| @@ -242,43 +245,49 @@ mod changes { · 4 unmodified lines |
| 242 | 245 | |
| 243 | 246 | ); |
| 244 | 247 | |
| 245 | | − assert_hash_agnostic_eq!( |
| 248 | + pretty_assertions::assert_eq!( |
| 246 | 249 | diff_with_previous_commit_from(&db, &all_commits["f/f modified"])?, |
| 247 | 250 | vec![ |
| 248 | 251 | Modification { |
| 249 | 252 | previous_entry_mode: EntryKind::Tree.into(), |
| 250 | | − previous_oid: hex_to_id("10f2f4b82222d2b5c31985130979a91fd87410f7"), |
| 253 | + previous_oid: hex_to_id("10f2f4b82222d2b5c31985130979a91fd87410f7", "9e220e584599b9cff376b638fa71675280f4582a87138b6be425258dbb85f94c"), |
| 251 | 254 | entry_mode: EntryKind::Tree.into(), |
| 252 | | − oid: hex_to_id("ebbe0b3000afdfd1aed15000094b59a2800328eb"), |
| 255 | + oid: hex_to_id("ebbe0b3000afdfd1aed15000094b59a2800328eb", "ca3ee6fe1455fc077ae53f0fe7af54153feb35d52a892b1377e9c0b6828428d4"), |
| 253 | 256 | path: "f".into() |
| 254 | 257 | }, |
| 255 | 258 | Modification { |
| 256 | 259 | previous_entry_mode: EntryKind::Blob.into(), |
| 257 | | − previous_oid: hex_to_id("28ce6a8b26aa170e1de65536fe8abe1832bd3242"), |
| 260 | + previous_oid: hex_to_id("28ce6a8b26aa170e1de65536fe8abe1832bd3242", "6ca8d4e3bc5df874055e542d18505b5a5efa0fb7d65776efedc13781073ed0f1"), |
| 258 | 261 | entry_mode: EntryKind::Blob.into(), |
| 259 | | − oid: hex_to_id("13c2aca72ab576cb5f22dc8e7f8ba8ddab553a8a"), |
| 262 | + oid: hex_to_id("13c2aca72ab576cb5f22dc8e7f8ba8ddab553a8a", "ab879bd65609705434bab6bc157306769fd1053c6d86d82c89e76df9bee62809"), |
| 260 | 263 | path: "f/f".into() |
| 261 | 264 | }, |
| 262 | 265 | ], |
| 263 | 266 | ":100644 100644 28ce6a8b26aa170e1de65536fe8abe1832bd3242 13c2aca72ab576cb5f22dc8e7f8ba8ddab553a8a M f/f" |
| 264 | 267 | ); |
| 265 | 268 | |
| 266 | | − let tree_with_link_id = hex_to_id("7e26dba59b6336f87d1d4ae3505a2da302b91c76"); |
| 267 | | − let link_entry_oid = hex_to_id("2e65efe2a145dda7ee51d1741299f848e5bf752e"); |
| 269 | + let tree_with_link_id = hex_to_id( |
| 270 | + "7e26dba59b6336f87d1d4ae3505a2da302b91c76", |
| 271 | + "825cbacedb89cffe4fd6532846f376ab9cb8bc9e5cb399620d3592b714c2e95f", |
| 272 | + ); |
| 273 | + let link_entry_oid = hex_to_id( |
| 274 | + "2e65efe2a145dda7ee51d1741299f848e5bf752e", |
| 275 | + "eb337bcee2061c5313c9a1392116b6c76039e9e30d71467ae359b36277e17dc7", |
| 276 | + ); |
| 268 | 277 | let link_entry_mode = EntryKind::Link; |
| 269 | | − assert_hash_agnostic_eq!( |
| 278 | + pretty_assertions::assert_eq!( |
| 270 | 279 | diff_with_previous_commit_from(&db, &all_commits["f/f mode changed to link"])?, |
| 271 | 280 | vec![ |
| 272 | 281 | Modification { |
| 273 | 282 | previous_entry_mode: EntryKind::Tree.into(), |
| 274 | | − previous_oid: hex_to_id("849bd76db90b65ebbd2e6d3970ca70c96ee5592c"), |
| 283 | + previous_oid: hex_to_id("849bd76db90b65ebbd2e6d3970ca70c96ee5592c", "003781d2cca9a680f5ccfe0963614bb813dea1654968713b48a6a27490c3771e"), |
| 275 | 284 | entry_mode: EntryKind::Tree.into(), |
| 276 | 285 | oid: tree_with_link_id, |
| 277 | 286 | path: "f".into() |
| 278 | 287 | }, |
| 279 | 288 | Modification { |
| 280 | 289 | previous_entry_mode: EntryKind::Blob.into(), |
| 281 | | − previous_oid: hex_to_id("13c2aca72ab576cb5f22dc8e7f8ba8ddab553a8a"), |
| 290 | + previous_oid: hex_to_id("13c2aca72ab576cb5f22dc8e7f8ba8ddab553a8a", "ab879bd65609705434bab6bc157306769fd1053c6d86d82c89e76df9bee62809"), |
| 282 | 291 | entry_mode: link_entry_mode.into(), |
| 283 | 292 | oid: link_entry_oid, |
| 284 | 293 | path: "f/f".into() |
| @@ -287,12 +296,12 @@ mod changes { · 2 unmodified lines |
| 287 | 296 | ":100644 120000 13c2aca72ab576cb5f22dc8e7f8ba8ddab553a8a 2e65efe2a145dda7ee51d1741299f848e5bf752e T f/f" |
| 288 | 297 | ); |
| 289 | 298 | |
| 290 | | − assert_hash_agnostic_eq!( |
| 299 | + pretty_assertions::assert_eq!( |
| 291 | 300 | diff_with_previous_commit_from(&db, &all_commits["f/ changed into file f"])?, |
| 292 | 301 | vec![ |
| 293 | 302 | Addition { |
| 294 | 303 | entry_mode: EntryKind::Blob.into(), |
| 295 | | − oid: hex_to_id("e69de29bb2d1d6434b8b29ae775ad8c2e48c5391"), |
| 304 | + oid: hex_to_id("e69de29bb2d1d6434b8b29ae775ad8c2e48c5391", "473a0f4c3be8a93681a267e3b1e9a7dcda1185436fe141f7749120a303721813"), |
| 296 | 305 | path: "f".into(), |
| 297 | 306 | relation: None |
| 298 | 307 | }, |
| @@ -304,13 +313,13 @@ mod changes { · 5 unmodified lines |
| 304 | 313 | }, |
| 305 | 314 | Deletion { |
| 306 | 315 | entry_mode: EntryKind::Blob.into(), |
| 307 | | − oid: hex_to_id("e69de29bb2d1d6434b8b29ae775ad8c2e48c5391"), |
| 316 | + oid: hex_to_id("e69de29bb2d1d6434b8b29ae775ad8c2e48c5391", "473a0f4c3be8a93681a267e3b1e9a7dcda1185436fe141f7749120a303721813"), |
| 308 | 317 | path: "f/a".into(), |
| 309 | 318 | relation: Some(Relation::ChildOfParent(1)) |
| 310 | 319 | }, |
| 311 | 320 | Deletion { |
| 312 | 321 | entry_mode: EntryKind::Blob.into(), |
| 313 | | − oid: hex_to_id("e69de29bb2d1d6434b8b29ae775ad8c2e48c5391"), |
| 322 | + oid: hex_to_id("e69de29bb2d1d6434b8b29ae775ad8c2e48c5391", "473a0f4c3be8a93681a267e3b1e9a7dcda1185436fe141f7749120a303721813"), |
| 314 | 323 | path: "f/b".into(), |
| 315 | 324 | relation: Some(Relation::ChildOfParent(1)) |
| 316 | 325 | }, |
| @@ -326,42 +335,46 @@ mod changes { · 9 unmodified lines |
| 326 | 335 | :100644 000000 e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 0000000000000000000000000000000000000000 D f/b |
| 327 | 336 | :120000 000000 2e65efe2a145dda7ee51d1741299f848e5bf752e 0000000000000000000000000000000000000000 D f/f" |
| 328 | 337 | ); |
| 329 | | − assert_hash_agnostic_eq!( |
| 338 | + pretty_assertions::assert_eq!( |
| 330 | 339 | diff_with_previous_commit_from(&db, &all_commits["delete d/"])?, |
| 331 | 340 | vec![ |
| 332 | 341 | Deletion { |
| 333 | 342 | entry_mode: EntryKind::Tree.into(), |
| 334 | | − oid: hex_to_id("3d5a503f4062d198b443db5065ca727f8354e7df"), |
| 343 | + oid: hex_to_id("3d5a503f4062d198b443db5065ca727f8354e7df", "1f5422fc234c61cf503a86521bcafcb86cc48653c5d80d4e93a6cc677e345b40"), |
| 335 | 344 | path: "d".into(), |
| 336 | 345 | relation: Some(Relation::Parent(1)) |
| 337 | 346 | }, |
| 338 | 347 | Deletion { |
| 339 | 348 | entry_mode: EntryKind::Blob.into(), |
| 340 | | − oid: hex_to_id("e69de29bb2d1d6434b8b29ae775ad8c2e48c5391"), |
| 349 | + oid: hex_to_id("e69de29bb2d1d6434b8b29ae775ad8c2e48c5391", "473a0f4c3be8a93681a267e3b1e9a7dcda1185436fe141f7749120a303721813"), |
| 341 | 350 | path: "d/f".into(), |
| 342 | 351 | relation: Some(Relation::ChildOfParent(1)) |
| 343 | 352 | }, |
| 344 | 353 | ], |
| 345 | 354 | ":100644 000000 e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 0000000000000000000000000000000000000000 D d/f" |
| 346 | 355 | ); |
| 347 | | − assert_hash_agnostic_eq!( |
| 356 | + let empty_blob_id = hex_to_id( |
| 357 | + "e69de29bb2d1d6434b8b29ae775ad8c2e48c5391", |
| 358 | + "473a0f4c3be8a93681a267e3b1e9a7dcda1185436fe141f7749120a303721813", |
| 359 | + ); |
| 360 | + pretty_assertions::assert_eq!( |
| 348 | 361 | diff_with_previous_commit_from(&db, &all_commits["add /c /d /e"])?, |
| 349 | 362 | vec![ |
| 350 | 363 | Addition { |
| 351 | 364 | entry_mode: EntryKind::Blob.into(), |
| 352 | | − oid: hex_to_id("e69de29bb2d1d6434b8b29ae775ad8c2e48c5391"), |
| 365 | + oid: empty_blob_id, |
| 353 | 366 | path: "c".into(), |
| 354 | 367 | relation: None, |
| 355 | 368 | }, |
| 356 | 369 | Addition { |
| 357 | 370 | entry_mode: EntryKind::Blob.into(), |
| 358 | | − oid: hex_to_id("e69de29bb2d1d6434b8b29ae775ad8c2e48c5391"), |
| 371 | + oid: empty_blob_id, |
| 359 | 372 | path: "d".into(), |
| 360 | 373 | relation: None, |
| 361 | 374 | }, |
| 362 | 375 | Addition { |
| 363 | 376 | entry_mode: EntryKind::Blob.into(), |
| 364 | | − oid: hex_to_id("e69de29bb2d1d6434b8b29ae775ad8c2e48c5391"), |
| 377 | + oid: empty_blob_id, |
| 365 | 378 | path: "e".into(), |
| 366 | 379 | relation: None, |
| 367 | 380 | }, |
| @@ -370,42 +383,42 @@ mod changes { · 2 unmodified lines |
| 370 | 383 | :000000 100644 0000000000000000000000000000000000000000 e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 A d |
| 371 | 384 | :000000 100644 0000000000000000000000000000000000000000 e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 A e" |
| 372 | 385 | ); |
| 373 | | − assert_hash_agnostic_eq!( |
| 386 | + pretty_assertions::assert_eq!( |
| 374 | 387 | diff_with_previous_commit_from(&db, &all_commits["add g/a"])?, |
| 375 | 388 | vec![ |
| 376 | 389 | Addition { |
| 377 | 390 | entry_mode: EntryKind::Tree.into(), |
| 378 | | − oid: hex_to_id("496d6428b9cf92981dc9495211e6e1120fb6f2ba"), |
| 391 | + oid: hex_to_id("496d6428b9cf92981dc9495211e6e1120fb6f2ba", "5f6f307bcc469c02acba4f7da42d8d4defdda8209777fe732956f1e2fa0db3ff"), |
| 379 | 392 | path: "g".into(), |
| 380 | 393 | relation: Some(Relation::Parent(1)) |
| 381 | 394 | }, |
| 382 | 395 | Addition { |
| 383 | 396 | entry_mode: EntryKind::Blob.into(), |
| 384 | | − oid: hex_to_id("e69de29bb2d1d6434b8b29ae775ad8c2e48c5391"), |
| 397 | + oid: hex_to_id("e69de29bb2d1d6434b8b29ae775ad8c2e48c5391", "473a0f4c3be8a93681a267e3b1e9a7dcda1185436fe141f7749120a303721813"), |
| 385 | 398 | path: "g/a".into(), |
| 386 | 399 | relation: Some(Relation::ChildOfParent(1)) |
| 387 | 400 | }, |
| 388 | 401 | ], |
| 389 | 402 | ":000000 100644 0000000000000000000000000000000000000000 e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 A g/a" |
| 390 | 403 | ); |
| 391 | | − assert_hash_agnostic_eq!( |
| 404 | + pretty_assertions::assert_eq!( |
| 392 | 405 | diff_with_previous_commit_from(&db, &all_commits["remove /c /d /e"])?, |
| 393 | 406 | vec![ |
| 394 | 407 | Deletion { |
| 395 | 408 | entry_mode: EntryKind::Blob.into(), |
| 396 | | − oid: hex_to_id("e69de29bb2d1d6434b8b29ae775ad8c2e48c5391"), |
| 409 | + oid: empty_blob_id, |
| 397 | 410 | path: "c".into(), |
| 398 | 411 | relation: None |
| 399 | 412 | }, |
| 400 | 413 | Deletion { |
| 401 | 414 | entry_mode: EntryKind::Blob.into(), |
| 402 | | − oid: hex_to_id("e69de29bb2d1d6434b8b29ae775ad8c2e48c5391"), |
| 415 | + oid: empty_blob_id, |
| 403 | 416 | path: "d".into(), |
| 404 | 417 | relation: None |
| 405 | 418 | }, |
| 406 | 419 | Deletion { |
| 407 | 420 | entry_mode: EntryKind::Blob.into(), |
| 408 | | − oid: hex_to_id("e69de29bb2d1d6434b8b29ae775ad8c2e48c5391"), |
| 421 | + oid: empty_blob_id, |
| 409 | 422 | path: "e".into(), |
| 410 | 423 | relation: None |
| 411 | 424 | }, |
| @@ -414,18 +427,18 @@ mod changes { · 2 unmodified lines |
| 414 | 427 | :100644 000000 e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 0000000000000000000000000000000000000000 D d |
| 415 | 428 | :100644 000000 e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 0000000000000000000000000000000000000000 D e" |
| 416 | 429 | ); |
| 417 | | − assert_hash_agnostic_eq!( |
| 430 | + pretty_assertions::assert_eq!( |
| 418 | 431 | diff_with_previous_commit_from(&db, &all_commits["rm /f, add /ff"])?, |
| 419 | 432 | vec![ |
| 420 | 433 | Deletion { |
| 421 | 434 | entry_mode: EntryKind::Blob.into(), |
| 422 | | − oid: hex_to_id("e69de29bb2d1d6434b8b29ae775ad8c2e48c5391"), |
| 435 | + oid: hex_to_id("e69de29bb2d1d6434b8b29ae775ad8c2e48c5391", "473a0f4c3be8a93681a267e3b1e9a7dcda1185436fe141f7749120a303721813"), |
| 423 | 436 | path: "f".into(), |
| 424 | 437 | relation: None |
| 425 | 438 | }, |
| 426 | 439 | Addition { |
| 427 | 440 | entry_mode: EntryKind::Blob.into(), |
| 428 | | − oid: hex_to_id("e69de29bb2d1d6434b8b29ae775ad8c2e48c5391"), |
| 441 | + oid: hex_to_id("e69de29bb2d1d6434b8b29ae775ad8c2e48c5391", "473a0f4c3be8a93681a267e3b1e9a7dcda1185436fe141f7749120a303721813"), |
| 429 | 442 | path: "ff".into(), |
| 430 | 443 | relation: None |
| 431 | 444 | }, |
| @@ -433,25 +446,25 @@ mod changes { · 1 unmodified line |
| 433 | 446 | ":100644 000000 e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 0000000000000000000000000000000000000000 D f |
| 434 | 447 | :000000 100644 0000000000000000000000000000000000000000 e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 A ff" |
| 435 | 448 | ); |
| 436 | | − assert_hash_agnostic_eq!( |
| 449 | + pretty_assertions::assert_eq!( |
| 437 | 450 | diff_with_previous_commit_from(&db, &all_commits["rm g/a, add g/aa"])?, |
| 438 | 451 | vec![ |
| 439 | 452 | Modification { |
| 440 | 453 | previous_entry_mode: EntryKind::Tree.into(), |
| 441 | | − previous_oid: hex_to_id("496d6428b9cf92981dc9495211e6e1120fb6f2ba"), |
| 454 | + previous_oid: hex_to_id("496d6428b9cf92981dc9495211e6e1120fb6f2ba", "5f6f307bcc469c02acba4f7da42d8d4defdda8209777fe732956f1e2fa0db3ff"), |
| 442 | 455 | entry_mode: EntryKind::Tree.into(), |
| 443 | | − oid: hex_to_id("6e5931346904b020301f74f581142826eacc4678"), |
| 456 | + oid: hex_to_id("6e5931346904b020301f74f581142826eacc4678", "c56aa83b78552302a7ab7c6377d8a54573a3845e10242df3eae849394ab91b53"), |
| 444 | 457 | path: "g".into() |
| 445 | 458 | }, |
| 446 | 459 | Deletion { |
| 447 | 460 | entry_mode: EntryKind::Blob.into(), |
| 448 | | − oid: hex_to_id("e69de29bb2d1d6434b8b29ae775ad8c2e48c5391"), |
| 461 | + oid: hex_to_id("e69de29bb2d1d6434b8b29ae775ad8c2e48c5391", "473a0f4c3be8a93681a267e3b1e9a7dcda1185436fe141f7749120a303721813"), |
| 449 | 462 | path: "g/a".into(), |
| 450 | 463 | relation: None |
| 451 | 464 | }, |
| 452 | 465 | Addition { |
| 453 | 466 | entry_mode: EntryKind::Blob.into(), |
| 454 | | − oid: hex_to_id("e69de29bb2d1d6434b8b29ae775ad8c2e48c5391"), |
| 467 | + oid: hex_to_id("e69de29bb2d1d6434b8b29ae775ad8c2e48c5391", "473a0f4c3be8a93681a267e3b1e9a7dcda1185436fe141f7749120a303721813"), |
| 455 | 468 | path: "g/aa".into(), |
| 456 | 469 | relation: None |
| 457 | 470 | }, |
| @@ -459,18 +472,18 @@ mod changes { · 1 unmodified line |
| 459 | 472 | ":100644 000000 e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 0000000000000000000000000000000000000000 D g/a |
| 460 | 473 | :000000 100644 0000000000000000000000000000000000000000 e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 A g/aa" |
| 461 | 474 | ); |
| 462 | | − assert_hash_agnostic_eq!( |
| 475 | + pretty_assertions::assert_eq!( |
| 463 | 476 | diff_with_previous_commit_from(&db, &all_commits["rm /ff, add /f"])?, |
| 464 | 477 | vec![ |
| 465 | 478 | Addition { |
| 466 | 479 | entry_mode: EntryKind::Blob.into(), |
| 467 | | − oid: hex_to_id("e69de29bb2d1d6434b8b29ae775ad8c2e48c5391"), |
| 480 | + oid: hex_to_id("e69de29bb2d1d6434b8b29ae775ad8c2e48c5391", "473a0f4c3be8a93681a267e3b1e9a7dcda1185436fe141f7749120a303721813"), |
| 468 | 481 | path: "f".into(), |
| 469 | 482 | relation: None, |
| 470 | 483 | }, |
| 471 | 484 | Deletion { |
| 472 | 485 | entry_mode: EntryKind::Blob.into(), |
| 473 | | − oid: hex_to_id("e69de29bb2d1d6434b8b29ae775ad8c2e48c5391"), |
| 486 | + oid: hex_to_id("e69de29bb2d1d6434b8b29ae775ad8c2e48c5391", "473a0f4c3be8a93681a267e3b1e9a7dcda1185436fe141f7749120a303721813"), |
| 474 | 487 | path: "ff".into(), |
| 475 | 488 | relation: None, |
| 476 | 489 | }, |
| @@ -478,25 +491,25 @@ mod changes { · 1 unmodified line |
| 478 | 491 | ":100644 000000 e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 0000000000000000000000000000000000000000 D f |
| 479 | 492 | :000000 100644 0000000000000000000000000000000000000000 e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 A ff" |
| 480 | 493 | ); |
| 481 | | − assert_hash_agnostic_eq!( |
| 494 | + pretty_assertions::assert_eq!( |
| 482 | 495 | diff_with_previous_commit_from(&db, &all_commits["rm g/aa, add g/a"])?, |
| 483 | 496 | vec![ |
| 484 | 497 | Modification { |
| 485 | 498 | previous_entry_mode: EntryKind::Tree.into(), |
| 486 | | − previous_oid: hex_to_id("6e5931346904b020301f74f581142826eacc4678"), |
| 499 | + previous_oid: hex_to_id("6e5931346904b020301f74f581142826eacc4678", "c56aa83b78552302a7ab7c6377d8a54573a3845e10242df3eae849394ab91b53"), |
| 487 | 500 | entry_mode: EntryKind::Tree.into(), |
| 488 | | − oid: hex_to_id("496d6428b9cf92981dc9495211e6e1120fb6f2ba"), |
| 501 | + oid: hex_to_id("496d6428b9cf92981dc9495211e6e1120fb6f2ba", "5f6f307bcc469c02acba4f7da42d8d4defdda8209777fe732956f1e2fa0db3ff"), |
| 489 | 502 | path: "g".into() |
| 490 | 503 | }, |
| 491 | 504 | Addition { |
| 492 | 505 | entry_mode: EntryKind::Blob.into(), |
| 493 | | − oid: hex_to_id("e69de29bb2d1d6434b8b29ae775ad8c2e48c5391"), |
| 506 | + oid: hex_to_id("e69de29bb2d1d6434b8b29ae775ad8c2e48c5391", "473a0f4c3be8a93681a267e3b1e9a7dcda1185436fe141f7749120a303721813"), |
| 494 | 507 | path: "g/a".into(), |
| 495 | 508 | relation: None, |
| 496 | 509 | }, |
| 497 | 510 | Deletion { |
| 498 | 511 | entry_mode: EntryKind::Blob.into(), |
| 499 | | − oid: hex_to_id("e69de29bb2d1d6434b8b29ae775ad8c2e48c5391"), |
| 512 | + oid: hex_to_id("e69de29bb2d1d6434b8b29ae775ad8c2e48c5391", "473a0f4c3be8a93681a267e3b1e9a7dcda1185436fe141f7749120a303721813"), |
| 500 | 513 | path: "g/aa".into(), |
| 501 | 514 | relation: None, |
| 502 | 515 | }, |
| @@ -512,39 +525,39 @@ mod changes { · 9 unmodified lines |
| 512 | 525 | let db = db(["a"].iter().copied())?; |
| 513 | 526 | let all_commits = all_commits(&db); |
| 514 | 527 | |
| 515 | | − assert_hash_agnostic_eq!( |
| 528 | + pretty_assertions::assert_eq!( |
| 516 | 529 | diff_with_previous_commit_from(&db, &all_commits["f added"])?, |
| 517 | 530 | vec![ |
| 518 | 531 | Addition { |
| 519 | 532 | entry_mode: EntryKind::Tree.into(), |
| 520 | | − oid: hex_to_id("3d5a503f4062d198b443db5065ca727f8354e7df"), |
| 533 | + oid: hex_to_id("3d5a503f4062d198b443db5065ca727f8354e7df", "1f5422fc234c61cf503a86521bcafcb86cc48653c5d80d4e93a6cc677e345b40"), |
| 521 | 534 | path: "a".into(), |
| 522 | 535 | relation: Some(Relation::Parent(1)), |
| 523 | 536 | }, |
| 524 | 537 | Addition { |
| 525 | 538 | entry_mode: EntryKind::Blob.into(), |
| 526 | | − oid: hex_to_id("e69de29bb2d1d6434b8b29ae775ad8c2e48c5391"), |
| 539 | + oid: hex_to_id("e69de29bb2d1d6434b8b29ae775ad8c2e48c5391", "473a0f4c3be8a93681a267e3b1e9a7dcda1185436fe141f7749120a303721813"), |
| 527 | 540 | path: "a/f".into(), |
| 528 | 541 | relation: Some(Relation::ChildOfParent(1)), |
| 529 | 542 | } |
| 530 | 543 | ], |
| 531 | 544 | ":000000 100644 0000000000000000000000000000000000000000 e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 A a/f" |
| 532 | 545 | ); |
| 533 | | − assert_hash_agnostic_eq!( |
| 546 | + pretty_assertions::assert_eq!( |
| 534 | 547 | diff_with_previous_commit_from(&db, &all_commits["f modified"])?, |
| 535 | 548 | vec![ |
| 536 | 549 | Modification { |
| 537 | 550 | previous_entry_mode: EntryKind::Tree.into(), |
| 538 | | − previous_oid: hex_to_id("3d5a503f4062d198b443db5065ca727f8354e7df"), |
| 551 | + previous_oid: hex_to_id("3d5a503f4062d198b443db5065ca727f8354e7df", "1f5422fc234c61cf503a86521bcafcb86cc48653c5d80d4e93a6cc677e345b40"), |
| 539 | 552 | entry_mode: EntryKind::Tree.into(), |
| 540 | | − oid: hex_to_id("10f2f4b82222d2b5c31985130979a91fd87410f7"), |
| 553 | + oid: hex_to_id("10f2f4b82222d2b5c31985130979a91fd87410f7", "9e220e584599b9cff376b638fa71675280f4582a87138b6be425258dbb85f94c"), |
| 541 | 554 | path: "a".into() |
| 542 | 555 | }, |
| 543 | 556 | Modification { |
| 544 | 557 | previous_entry_mode: EntryKind::Blob.into(), |
| 545 | | − previous_oid: hex_to_id("e69de29bb2d1d6434b8b29ae775ad8c2e48c5391"), |
| 558 | + previous_oid: hex_to_id("e69de29bb2d1d6434b8b29ae775ad8c2e48c5391", "473a0f4c3be8a93681a267e3b1e9a7dcda1185436fe141f7749120a303721813"), |
| 546 | 559 | entry_mode: EntryKind::Blob.into(), |
| 547 | | − oid: hex_to_id("28ce6a8b26aa170e1de65536fe8abe1832bd3242"), |
| 560 | + oid: hex_to_id("28ce6a8b26aa170e1de65536fe8abe1832bd3242", "6ca8d4e3bc5df874055e542d18505b5a5efa0fb7d65776efedc13781073ed0f1"), |
| 548 | 561 | path: "a/f".into() |
| 549 | 562 | } |
| 550 | 563 | ], |
| @@ -567,47 +580,57 @@ mod changes { · 16 unmodified lines |
| 567 | 580 | |
| 568 | 581 | let last_commit = all_commits["rm g/aa, add g/a"]; |
| 569 | 582 | let first_commit = all_commits["f added"]; |
| 570 | | − assert_hash_agnostic_eq!( |
| 583 | + let empty_blob_id = hex_to_id( |
| 584 | + "e69de29bb2d1d6434b8b29ae775ad8c2e48c5391", |
| 585 | + "473a0f4c3be8a93681a267e3b1e9a7dcda1185436fe141f7749120a303721813", |
| 586 | + ); |
| 587 | + pretty_assertions::assert_eq!( |
| 571 | 588 | diff_commits(&db, first_commit.to_owned(), &last_commit, None)?, |
| 572 | 589 | vec![ |
| 573 | 590 | Addition { |
| 574 | 591 | entry_mode: EntryKind::Blob.into(), |
| 575 | | − oid: hex_to_id("e69de29bb2d1d6434b8b29ae775ad8c2e48c5391"), |
| 592 | + oid: empty_blob_id, |
| 576 | 593 | path: "".into(), |
| 577 | 594 | relation: None |
| 578 | 595 | }, |
| 579 | 596 | Addition { |
| 580 | 597 | entry_mode: EntryKind::Tree.into(), |
| 581 | | − oid: hex_to_id("496d6428b9cf92981dc9495211e6e1120fb6f2ba"), |
| 598 | + oid: hex_to_id( |
| 599 | + "496d6428b9cf92981dc9495211e6e1120fb6f2ba", |
| 600 | + "5f6f307bcc469c02acba4f7da42d8d4defdda8209777fe732956f1e2fa0db3ff" |
| 601 | + ), |
| 582 | 602 | path: "".into(), |
| 583 | 603 | relation: Some(Relation::Parent(1)) |
| 584 | 604 | }, |
| 585 | 605 | Addition { |
| 586 | 606 | entry_mode: EntryKind::Blob.into(), |
| 587 | | − oid: hex_to_id("e69de29bb2d1d6434b8b29ae775ad8c2e48c5391"), |
| 607 | + oid: empty_blob_id, |
| 588 | 608 | path: "".into(), |
| 589 | 609 | relation: Some(Relation::ChildOfParent(1)) |
| 590 | 610 | } |
| 591 | 611 | ] |
| 592 | 612 | ); |
| 593 | | − assert_hash_agnostic_eq!( |
| 613 | + pretty_assertions::assert_eq!( |
| 594 | 614 | diff_commits(&db, last_commit.to_owned(), &first_commit, Location::FileName.into())?, |
| 595 | 615 | vec![ |
| 596 | 616 | Deletion { |
| 597 | 617 | entry_mode: EntryKind::Blob.into(), |
| 598 | | − oid: hex_to_id("e69de29bb2d1d6434b8b29ae775ad8c2e48c5391"), |
| 618 | + oid: empty_blob_id, |
| 599 | 619 | path: "b".into(), |
| 600 | 620 | relation: None |
| 601 | 621 | }, |
| 602 | 622 | Deletion { |
| 603 | 623 | entry_mode: EntryKind::Tree.into(), |
| 604 | | − oid: hex_to_id("496d6428b9cf92981dc9495211e6e1120fb6f2ba"), |
| 624 | + oid: hex_to_id( |
| 625 | + "496d6428b9cf92981dc9495211e6e1120fb6f2ba", |
| 626 | + "5f6f307bcc469c02acba4f7da42d8d4defdda8209777fe732956f1e2fa0db3ff" |
| 627 | + ), |
| 605 | 628 | path: "g".into(), |
| 606 | 629 | relation: Some(Relation::Parent(1)) |
| 607 | 630 | }, |
| 608 | 631 | Deletion { |
| 609 | 632 | entry_mode: EntryKind::Blob.into(), |
| 610 | | − oid: hex_to_id("e69de29bb2d1d6434b8b29ae775ad8c2e48c5391"), |
| 633 | + oid: empty_blob_id, |
| 611 | 634 | path: "a".into(), |
| 612 | 635 | relation: Some(Relation::ChildOfParent(1)) |
| 613 | 636 | } |
| @@ -620,55 +643,65 @@ mod changes { · 6 unmodified lines |
| 620 | 643 | fn maximal_difference_nested() -> crate::Result { |
| 621 | 644 | let db = db(["a"].iter().copied())?; |
| 622 | 645 | let all_commits = all_commits(&db); |
| 646 | + let empty_blob_id = hex_to_id( |
| 647 | + "e69de29bb2d1d6434b8b29ae775ad8c2e48c5391", |
| 648 | + "473a0f4c3be8a93681a267e3b1e9a7dcda1185436fe141f7749120a303721813", |
| 649 | + ); |
| 623 | 650 | |
| 624 | | − assert_hash_agnostic_eq!( |
| 651 | + pretty_assertions::assert_eq!( |
| 625 | 652 | diff_commits(&db, None::<ObjectId>, &all_commits["add g/a"], Some(Location::Path))?, |
| 626 | 653 | vec![ |
| 627 | 654 | Addition { |
| 628 | 655 | entry_mode: EntryKind::Tree.into(), |
| 629 | | − oid: hex_to_id("0df4d0ed769eacd0a231e7512fca25d3cabdeca4"), |
| 656 | + oid: hex_to_id( |
| 657 | + "0df4d0ed769eacd0a231e7512fca25d3cabdeca4", |
| 658 | + "dac24a12e6d43c6ad271e7ea4f021093dac44f15f99317b2e0d54753b4f09099" |
| 659 | + ), |
| 630 | 660 | path: "a".into(), |
| 631 | 661 | relation: Some(Relation::Parent(1)), |
| 632 | 662 | }, |
| 633 | 663 | Addition { |
| 634 | 664 | entry_mode: EntryKind::Blob.into(), |
| 635 | | − oid: hex_to_id("e69de29bb2d1d6434b8b29ae775ad8c2e48c5391"), |
| 665 | + oid: empty_blob_id, |
| 636 | 666 | path: "a/b".into(), |
| 637 | 667 | relation: Some(Relation::ChildOfParent(1)), |
| 638 | 668 | }, |
| 639 | 669 | Addition { |
| 640 | 670 | entry_mode: EntryKind::Blob.into(), |
| 641 | | − oid: hex_to_id("e69de29bb2d1d6434b8b29ae775ad8c2e48c5391"), |
| 671 | + oid: empty_blob_id, |
| 642 | 672 | path: "a/c".into(), |
| 643 | 673 | relation: Some(Relation::ChildOfParent(1)), |
| 644 | 674 | }, |
| 645 | 675 | Addition { |
| 646 | 676 | entry_mode: EntryKind::Blob.into(), |
| 647 | | − oid: hex_to_id("e69de29bb2d1d6434b8b29ae775ad8c2e48c5391"), |
| 677 | + oid: empty_blob_id, |
| 648 | 678 | path: "a/d".into(), |
| 649 | 679 | relation: Some(Relation::ChildOfParent(1)), |
| 650 | 680 | }, |
| 651 | 681 | Addition { |
| 652 | 682 | entry_mode: EntryKind::Blob.into(), |
| 653 | | − oid: hex_to_id("e69de29bb2d1d6434b8b29ae775ad8c2e48c5391"), |
| 683 | + oid: empty_blob_id, |
| 654 | 684 | path: "a/e".into(), |
| 655 | 685 | relation: Some(Relation::ChildOfParent(1)), |
| 656 | 686 | }, |
| 657 | 687 | Addition { |
| 658 | 688 | entry_mode: EntryKind::Blob.into(), |
| 659 | | − oid: hex_to_id("e69de29bb2d1d6434b8b29ae775ad8c2e48c5391"), |
| 689 | + oid: empty_blob_id, |
| 660 | 690 | path: "a/f".into(), |
| 661 | 691 | relation: Some(Relation::ChildOfParent(1)), |
| 662 | 692 | }, |
| 663 | 693 | Addition { |
| 664 | 694 | entry_mode: EntryKind::Tree.into(), |
| 665 | | − oid: hex_to_id("496d6428b9cf92981dc9495211e6e1120fb6f2ba"), |
| 695 | + oid: hex_to_id( |
| 696 | + "496d6428b9cf92981dc9495211e6e1120fb6f2ba", |
| 697 | + "5f6f307bcc469c02acba4f7da42d8d4defdda8209777fe732956f1e2fa0db3ff" |
| 698 | + ), |
| 666 | 699 | path: "a/g".into(), |
| 667 | 700 | relation: Some(Relation::ChildOfParent(1)), |
| 668 | 701 | }, |
| 669 | 702 | Addition { |
| 670 | 703 | entry_mode: EntryKind::Blob.into(), |
| 671 | | − oid: hex_to_id("e69de29bb2d1d6434b8b29ae775ad8c2e48c5391"), |
| 704 | + oid: empty_blob_id, |
| 672 | 705 | path: "a/g/a".into(), |
| 673 | 706 | relation: Some(Relation::ChildOfParent(1)), |
| 674 | 707 | } |
| @@ -681,67 +714,83 @@ mod changes { · 6 unmodified lines |
| 681 | 714 | fn directory_rename() -> crate::Result { |
| 682 | 715 | let db = db(None)?; |
| 683 | 716 | let all_commits = all_commits(&db); |
| 717 | + let empty_blob_id = hex_to_id( |
| 718 | + "e69de29bb2d1d6434b8b29ae775ad8c2e48c5391", |
| 719 | + "473a0f4c3be8a93681a267e3b1e9a7dcda1185436fe141f7749120a303721813", |
| 720 | + ); |
| 684 | 721 | |
| 685 | | − assert_hash_agnostic_eq!( |
| 722 | + pretty_assertions::assert_eq!( |
| 686 | 723 | diff_with_previous_commit_from(&db, &all_commits["rename git-sec to gix-sec"])?, |
| 687 | 724 | vec![ |
| 688 | 725 | Deletion { |
| 689 | 726 | entry_mode: EntryKind::Tree.into(), |
| 690 | | − oid: hex_to_id("d8c30fb72173778ed57fac5813c5e37038a8746c"), |
| 727 | + oid: hex_to_id( |
| 728 | + "d8c30fb72173778ed57fac5813c5e37038a8746c", |
| 729 | + "52a70042eff6fbeed1d6c8c0ed2f9cc775a19cc51b395429c4210bc5091520ad" |
| 730 | + ), |
| 691 | 731 | path: "git-sec".into(), |
| 692 | 732 | relation: Some(Relation::Parent(1)), |
| 693 | 733 | }, |
| 694 | 734 | Addition { |
| 695 | 735 | entry_mode: EntryKind::Tree.into(), |
| 696 | | − oid: hex_to_id("d8c30fb72173778ed57fac5813c5e37038a8746c"), |
| 736 | + oid: hex_to_id( |
| 737 | + "d8c30fb72173778ed57fac5813c5e37038a8746c", |
| 738 | + "52a70042eff6fbeed1d6c8c0ed2f9cc775a19cc51b395429c4210bc5091520ad" |
| 739 | + ), |
| 697 | 740 | path: "gix-sec".into(), |
| 698 | 741 | relation: Some(Relation::Parent(2)), |
| 699 | 742 | }, |
| 700 | 743 | Deletion { |
| 701 | 744 | entry_mode: EntryKind::Blob.into(), |
| 702 | | − oid: hex_to_id("e69de29bb2d1d6434b8b29ae775ad8c2e48c5391"), |
| 745 | + oid: empty_blob_id, |
| 703 | 746 | path: "git-sec/2".into(), |
| 704 | 747 | relation: Some(Relation::ChildOfParent(1)), |
| 705 | 748 | }, |
| 706 | 749 | Deletion { |
| 707 | 750 | entry_mode: EntryKind::Blob.into(), |
| 708 | | − oid: hex_to_id("e69de29bb2d1d6434b8b29ae775ad8c2e48c5391"), |
| 751 | + oid: empty_blob_id, |
| 709 | 752 | path: "git-sec/7".into(), |
| 710 | 753 | relation: Some(Relation::ChildOfParent(1)), |
| 711 | 754 | }, |
| 712 | 755 | Deletion { |
| 713 | 756 | entry_mode: EntryKind::Tree.into(), |
| 714 | | − oid: hex_to_id("fd7938a0c18f993c89eda3f40a6d06fa6785833c"), |
| 757 | + oid: hex_to_id( |
| 758 | + "fd7938a0c18f993c89eda3f40a6d06fa6785833c", |
| 759 | + "5b2e08d098c63c2f31c8937c810f77ff005c48833701e0854f690188f1887aae" |
| 760 | + ), |
| 715 | 761 | path: "git-sec/subdir".into(), |
| 716 | 762 | relation: Some(Relation::ChildOfParent(1)), |
| 717 | 763 | }, |
| 718 | 764 | Addition { |
| 719 | 765 | entry_mode: EntryKind::Blob.into(), |
| 720 | | − oid: hex_to_id("e69de29bb2d1d6434b8b29ae775ad8c2e48c5391"), |
| 766 | + oid: empty_blob_id, |
| 721 | 767 | path: "gix-sec/2".into(), |
| 722 | 768 | relation: Some(Relation::ChildOfParent(2)), |
| 723 | 769 | }, |
| 724 | 770 | Addition { |
| 725 | 771 | entry_mode: EntryKind::Blob.into(), |
| 726 | | − oid: hex_to_id("e69de29bb2d1d6434b8b29ae775ad8c2e48c5391"), |
| 772 | + oid: empty_blob_id, |
| 727 | 773 | path: "gix-sec/7".into(), |
| 728 | 774 | relation: Some(Relation::ChildOfParent(2)), |
| 729 | 775 | }, |
| 730 | 776 | Addition { |
| 731 | 777 | entry_mode: EntryKind::Tree.into(), |
| 732 | | − oid: hex_to_id("fd7938a0c18f993c89eda3f40a6d06fa6785833c"), |
| 778 | + oid: hex_to_id( |
| 779 | + "fd7938a0c18f993c89eda3f40a6d06fa6785833c", |
| 780 | + "5b2e08d098c63c2f31c8937c810f77ff005c48833701e0854f690188f1887aae" |
| 781 | + ), |
| 733 | 782 | path: "gix-sec/subdir".into(), |
| 734 | 783 | relation: Some(Relation::ChildOfParent(2)), |
| 735 | 784 | }, |
| 736 | 785 | Deletion { |
| 737 | 786 | entry_mode: EntryKind::Blob.into(), |
| 738 | | − oid: hex_to_id("e69de29bb2d1d6434b8b29ae775ad8c2e48c5391"), |
| 787 | + oid: empty_blob_id, |
| 739 | 788 | path: "git-sec/subdir/6".into(), |
| 740 | 789 | relation: Some(Relation::ChildOfParent(1)), |
| 741 | 790 | }, |
| 742 | 791 | Addition { |
| 743 | 792 | entry_mode: EntryKind::Blob.into(), |
| 744 | | − oid: hex_to_id("e69de29bb2d1d6434b8b29ae775ad8c2e48c5391"), |
| 793 | + oid: empty_blob_id, |
| 745 | 794 | path: "gix-sec/subdir/6".into(), |
| 746 | 795 | relation: Some(Relation::ChildOfParent(2)), |
| 747 | 796 | } |
| @@ -754,67 +803,83 @@ mod changes { · 6 unmodified lines |
| 754 | 803 | fn reverse_directory_rename() -> crate::Result { |
| 755 | 804 | let db = db(None)?; |
| 756 | 805 | let all_commits = all_commits(&db); |
| 806 | + let empty_blob_id = hex_to_id( |
| 807 | + "e69de29bb2d1d6434b8b29ae775ad8c2e48c5391", |
| 808 | + "473a0f4c3be8a93681a267e3b1e9a7dcda1185436fe141f7749120a303721813", |
| 809 | + ); |
| 757 | 810 | |
| 758 | | − assert_hash_agnostic_eq!( |
| 811 | + pretty_assertions::assert_eq!( |
| 759 | 812 | diff_with_previous_commit_from(&db, &all_commits["rename gix-sec to git-sec"])?, |
| 760 | 813 | vec![ |
| 761 | 814 | Addition { |
| 762 | 815 | entry_mode: EntryKind::Tree.into(), |
| 763 | | − oid: hex_to_id("d8c30fb72173778ed57fac5813c5e37038a8746c"), |
| 816 | + oid: hex_to_id( |
| 817 | + "d8c30fb72173778ed57fac5813c5e37038a8746c", |
| 818 | + "52a70042eff6fbeed1d6c8c0ed2f9cc775a19cc51b395429c4210bc5091520ad" |
| 819 | + ), |
| 764 | 820 | path: "git-sec".into(), |
| 765 | 821 | relation: Some(Relation::Parent(1)), |
| 766 | 822 | }, |
| 767 | 823 | Deletion { |
| 768 | 824 | entry_mode: EntryKind::Tree.into(), |
| 769 | | − oid: hex_to_id("d8c30fb72173778ed57fac5813c5e37038a8746c"), |
| 825 | + oid: hex_to_id( |
| 826 | + "d8c30fb72173778ed57fac5813c5e37038a8746c", |
| 827 | + "52a70042eff6fbeed1d6c8c0ed2f9cc775a19cc51b395429c4210bc5091520ad" |
| 828 | + ), |
| 770 | 829 | path: "gix-sec".into(), |
| 771 | 830 | relation: Some(Relation::Parent(2)), |
| 772 | 831 | }, |
| 773 | 832 | Addition { |
| 774 | 833 | entry_mode: EntryKind::Blob.into(), |
| 775 | | − oid: hex_to_id("e69de29bb2d1d6434b8b29ae775ad8c2e48c5391"), |
| 834 | + oid: empty_blob_id, |
| 776 | 835 | path: "git-sec/2".into(), |
| 777 | 836 | relation: Some(Relation::ChildOfParent(1)), |
| 778 | 837 | }, |
| 779 | 838 | Addition { |
| 780 | 839 | entry_mode: EntryKind::Blob.into(), |
| 781 | | − oid: hex_to_id("e69de29bb2d1d6434b8b29ae775ad8c2e48c5391"), |
| 840 | + oid: empty_blob_id, |
| 782 | 841 | path: "git-sec/7".into(), |
| 783 | 842 | relation: Some(Relation::ChildOfParent(1)), |
| 784 | 843 | }, |
| 785 | 844 | Addition { |
| 786 | 845 | entry_mode: EntryKind::Tree.into(), |
| 787 | | − oid: hex_to_id("fd7938a0c18f993c89eda3f40a6d06fa6785833c"), |
| 846 | + oid: hex_to_id( |
| 847 | + "fd7938a0c18f993c89eda3f40a6d06fa6785833c", |
| 848 | + "5b2e08d098c63c2f31c8937c810f77ff005c48833701e0854f690188f1887aae" |
| 849 | + ), |
| 788 | 850 | path: "git-sec/subdir".into(), |
| 789 | 851 | relation: Some(Relation::ChildOfParent(1)), |
| 790 | 852 | }, |
| 791 | 853 | Deletion { |
| 792 | 854 | entry_mode: EntryKind::Blob.into(), |
| 793 | | − oid: hex_to_id("e69de29bb2d1d6434b8b29ae775ad8c2e48c5391"), |
| 855 | + oid: empty_blob_id, |
| 794 | 856 | path: "gix-sec/2".into(), |
| 795 | 857 | relation: Some(Relation::ChildOfParent(2)), |
| 796 | 858 | }, |
| 797 | 859 | Deletion { |
| 798 | 860 | entry_mode: EntryKind::Blob.into(), |
| 799 | | − oid: hex_to_id("e69de29bb2d1d6434b8b29ae775ad8c2e48c5391"), |
| 861 | + oid: empty_blob_id, |
| 800 | 862 | path: "gix-sec/7".into(), |
| 801 | 863 | relation: Some(Relation::ChildOfParent(2)), |
| 802 | 864 | }, |
| 803 | 865 | Deletion { |
| 804 | 866 | entry_mode: EntryKind::Tree.into(), |
| 805 | | − oid: hex_to_id("fd7938a0c18f993c89eda3f40a6d06fa6785833c"), |
| 867 | + oid: hex_to_id( |
| 868 | + "fd7938a0c18f993c89eda3f40a6d06fa6785833c", |
| 869 | + "5b2e08d098c63c2f31c8937c810f77ff005c48833701e0854f690188f1887aae" |
| 870 | + ), |
| 806 | 871 | path: "gix-sec/subdir".into(), |
| 807 | 872 | relation: Some(Relation::ChildOfParent(2)), |
| 808 | 873 | }, |
| 809 | 874 | Addition { |
| 810 | 875 | entry_mode: EntryKind::Blob.into(), |
| 811 | | − oid: hex_to_id("e69de29bb2d1d6434b8b29ae775ad8c2e48c5391"), |
| 876 | + oid: empty_blob_id, |
| 812 | 877 | path: "git-sec/subdir/6".into(), |
| 813 | 878 | relation: Some(Relation::ChildOfParent(1)), |
| 814 | 879 | }, |
| 815 | 880 | Deletion { |
| 816 | 881 | entry_mode: EntryKind::Blob.into(), |
| 817 | | − oid: hex_to_id("e69de29bb2d1d6434b8b29ae775ad8c2e48c5391"), |
| 882 | + oid: empty_blob_id, |
| 818 | 883 | path: "gix-sec/subdir/6".into(), |
| 819 | 884 | relation: Some(Relation::ChildOfParent(2)), |
| 820 | 885 | } |