|
| 1 | +use crate::index::Fixture::*; |
1 | 2 | use filetime::FileTime; |
2 | 3 | use git_index::{decode, entry, extension, verify::extensions::no_find, write, write::Options, State, Version}; |
3 | 4 |
|
4 | | -use crate::{fixture_index_path, index::file::read::loose_file_path}; |
| 5 | +use crate::{fixture_index_path, loose_file_path}; |
5 | 6 |
|
6 | 7 | /// Round-trips should eventually be possible for all files we have, as we write them back exactly as they were read. |
7 | 8 | #[test] |
8 | 9 | fn roundtrips() -> crate::Result { |
9 | | - enum Kind { |
10 | | - Generated(&'static str), |
11 | | - Loose(&'static str), |
12 | | - } |
13 | | - use Kind::*; |
14 | 10 | let input = [ |
15 | 11 | (Loose("extended-flags"), all_ext_but_eoie()), |
16 | 12 | (Loose("conflicting-file"), all_ext_but_eoie()), |
@@ -54,12 +50,6 @@ fn state_comparisons_with_various_extension_configurations() { |
54 | 50 | } |
55 | 51 | } |
56 | 52 |
|
57 | | - enum Kind { |
58 | | - Generated(&'static str), |
59 | | - Loose(&'static str), |
60 | | - } |
61 | | - use Kind::*; |
62 | | - |
63 | 53 | for fixture in [ |
64 | 54 | Loose("extended-flags"), |
65 | 55 | Loose("conflicting-file"), |
@@ -87,10 +77,8 @@ fn state_comparisons_with_various_extension_configurations() { |
87 | 77 | end_of_index_entry: true, |
88 | 78 | }), |
89 | 79 | ] { |
90 | | - let (path, fixture) = match fixture { |
91 | | - Generated(name) => (fixture_index_path(name), name), |
92 | | - Loose(name) => (loose_file_path(name), name), |
93 | | - }; |
| 80 | + let path = fixture.to_path(); |
| 81 | + let fixture = fixture.to_name(); |
94 | 82 | let expected = git_index::File::at(&path, Default::default()).unwrap(); |
95 | 83 |
|
96 | 84 | let mut out = Vec::<u8>::new(); |
|
0 commit comments