History

refactor

Sebastian Thiel committed 4 years ago

Commit b2835cc1 parent f5959ed4 files · +15 −16Browse files

Unified · Split

4 files
  1. git-index/tests/fixtures/generated-archives/v2_all_file_kinds.tar.xz +1 −1
  2. git-index/tests/fixtures/make_index/v2_all_file_kinds.sh +6 −7
  3. git-index/tests/index/init.rs +2 −2
  4. git-pathspec/tests/pathspec.rs +6 −6
git-index/tests/fixtures/generated-archives/v2_all_file_kinds.tar.xz+1−1
@@ -1,3 +1,3 @@
11 version https://git-lfs.github.com/spec/v1
2−oid sha256:2b034a569959fd83c39e7aa870fea63b5fd8b87b5665e65881fade92592fc2c3
2+oid sha256:5acb6a5de229b312880af9847cefa54ccb8385f4273f0bb365f2af66dd789f0f
33 size 11040
git-index/tests/fixtures/make_index/v2_all_file_kinds.sh+6−7
@@ -4,13 +4,12 @@ set -eu -o pipefail · 3 unmodified lines
44 export GIT_INDEX_VERSION=2;
55
66 git init -q sub
7−cd sub
7+(cd sub
88
9−touch a b c
10−git add .
11−git commit -m "empty"
12−
13−cd ..
9+ touch a b c
10+ git add .
11+ git commit -m "init"
12+)
1413
1514 git init -q
1615 git config index.threads 1
@@ -22,4 +21,4 @@ mkdir d · 5 unmodified lines
2221 (cd d && touch a b c)
2322
2423 git add .
25−git commit -m "empty"
24+git commit -m "init"
git-index/tests/index/init.rs+2−2
@@ -38,10 +38,10 @@ fn compare_states(actual: &State, expected: &State, fixture: &str) { · 37 unmodified lines
3838 fixture
3939 );
4040
41− actual.entries().iter().zip(expected.entries()).for_each(|(a, e)| {
41+ for (a, e) in actual.entries().iter().zip(expected.entries()) {
4242 assert_eq!(a.id, e.id, "entry id mismatch in {:?}", fixture);
4343 assert_eq!(a.flags, e.flags, "entry flags mismatch in {:?}", fixture);
4444 assert_eq!(a.mode, e.mode, "entry mode mismatch in {:?}", fixture);
4545 assert_eq!(a.path(actual), e.path(expected), "entry path mismatch in {:?}", fixture);
46− })
46+ }
4747 }
git-pathspec/tests/pathspec.rs+6−6
@@ -284,7 +284,7 @@ mod parse { · 283 unmodified lines
284284 ":_()", ":`()", ":~()",
285285 ];
286286
287− inputs.into_iter().for_each(|input| {
287+ for input in inputs.into_iter() {
288288 assert!(
289289 !check_against_baseline(input),
290290 "This pathspec is valid in git: {}",
@@ -294,7 +294,7 @@ mod parse { · 3 unmodified lines
294294 let output = git_pathspec::parse(input.as_bytes());
295295 assert!(output.is_err());
296296 assert!(matches!(output.unwrap_err(), Error::Unimplemented { .. }));
297− });
297+ }
298298 }
299299
300300 #[test]
@@ -306,7 +306,7 @@ mod parse { · 5 unmodified lines
306306 ":(top,exclude,icse)some/path",
307307 ];
308308
309− inputs.into_iter().for_each(|input| {
309+ for input in inputs.into_iter() {
310310 assert!(
311311 !check_against_baseline(input),
312312 "This pathspec is valid in git: {}",
@@ -316,7 +316,7 @@ mod parse { · 3 unmodified lines
316316 let output = git_pathspec::parse(input.as_bytes());
317317 assert!(output.is_err());
318318 assert!(matches!(output.unwrap_err(), Error::InvalidKeyword { .. }));
319− });
319+ }
320320 }
321321
322322 #[test]
@@ -454,7 +454,7 @@ mod parse { · 131 unmodified lines
454454 }
455455
456456 fn check_valid_inputs<'a>(inputs: impl IntoIterator<Item = (&'a str, PatternForTesting)>) {
457− inputs.into_iter().for_each(|(input, expected)| {
457+ for (input, expected) in inputs.into_iter() {
458458 assert!(
459459 check_against_baseline(input),
460460 "This pathspec is invalid in git: {}",
@@ -465,7 +465,7 @@ mod parse { · 4 unmodified lines
465465 .unwrap_or_else(|_| panic!("parsing should not fail with pathspec {}", input))
466466 .into();
467467 assert_eq!(pattern, expected, "while checking input: \"{}\"", input);
468− });
468+ }
469469 }
470470
471471 fn pat_with_path(path: &str) -> PatternForTesting {