History

Merge pull request #1652 from EliahKagan/run-ci/chmod

Test cross-platform symlink and +x permission expectations on Windows

Sebastian Thiel committed 2 years ago

Commit 8e99eba2 parents 3fb989b d03971b24 files · +53 −65Browse files

Unified · Split

24 files
  1. gix-archive/tests/archive.rs +17 −16
  2. gix-archive/tests/fixtures/basic.sh +1 −1
  3. gix-dir/tests/fixtures/many-symlinks.sh +3 −4
  4. gix-dir/tests/fixtures/many.sh +1 −1
  5. gix-dir/tests/walk/mod.rs +0 −4
  6. gix-index/tests/fixtures/generated-archives/v2_all_file_kinds.tar +0 −0
  7. gix-index/tests/fixtures/make_index/v2_all_file_kinds.sh +2 −2
  8. gix-index/tests/fixtures/make_index/v2_deeper_tree.sh +2 −1
  9. gix-merge/tests/fixtures/generated-archives/tree-baseline.tar +0 −0
  10. gix-merge/tests/fixtures/tree-baseline.sh +6 −6
  11. gix-status/tests/fixtures/generated-archives/status_many.tar +0 −0
  12. gix-status/tests/fixtures/generated-archives/status_removed.tar +0 −0
  13. gix-status/tests/fixtures/status_changed.sh +2 −1
  14. gix-status/tests/fixtures/status_many.sh +1 −0
  15. gix-status/tests/fixtures/status_removed.sh +2 −1
  16. gix-status/tests/fixtures/status_unchanged.sh +2 −1
  17. gix-worktree-state/tests/fixtures/make_mixed.sh +1 −0
  18. gix-worktree-state/tests/fixtures/make_mixed_without_submodules.sh +1 −0
  19. gix-worktree-state/tests/fixtures/make_mixed_without_submodules_and_symlinks.sh +1 −0
  20. gix-worktree-state/tests/state/checkout.rs +4 −18
  21. gix-worktree-stream/tests/fixtures/basic.sh +1 −1
  22. gix-worktree-stream/tests/stream.rs +8 −10
  23. gix/tests/fixtures/generated-archives/make_rev_spec_parse_repos.tar +0 −0
  24. gix/tests/fixtures/make_rev_spec_parse_repos.sh +3 −3
gix-archive/tests/archive.rs+17−16
@@ -27,12 +27,6 @@ mod from_tree { · 26 unmodified lines
27 entry.read_to_end(&mut buf).expect("stream can always be read");27 entry.read_to_end(&mut buf).expect("stream can always be read");
28 }28 }
29 29
30 let expected_link_mode = EntryKind::Link;
31 let expected_exe_mode = if cfg!(windows) {
32 EntryKind::Blob
33 } else {
34 EntryKind::BlobExecutable
35 };
36 assert_eq!(30 assert_eq!(
37 paths_and_modes,31 paths_and_modes,
38 &[32 &[
@@ -48,7 +42,7 @@ mod from_tree { · 9 unmodified lines
48 ),42 ),
49 (43 (
50 "symlink-to-a".into(),44 "symlink-to-a".into(),
51 expected_link_mode,45 EntryKind::Link,
52 hex_to_id("2e65efe2a145dda7ee51d1741299f848e5bf752e")46 hex_to_id("2e65efe2a145dda7ee51d1741299f848e5bf752e")
53 ),47 ),
54 (48 (
@@ -58,7 +52,7 @@ mod from_tree { · 3 unmodified lines
58 ),52 ),
59 (53 (
60 "dir/subdir/exe".into(),54 "dir/subdir/exe".into(),
61 expected_exe_mode,55 EntryKind::BlobExecutable,
62 hex_to_id("e69de29bb2d1d6434b8b29ae775ad8c2e48c5391")56 hex_to_id("e69de29bb2d1d6434b8b29ae775ad8c2e48c5391")
63 ),57 ),
64 (58 (
@@ -68,7 +62,11 @@ mod from_tree { · 3 unmodified lines
68 ),62 ),
69 (63 (
70 "extra-exe".into(),64 "extra-exe".into(),
71 expected_exe_mode,65 if cfg!(windows) {
66 EntryKind::Blob
67 } else {
68 EntryKind::BlobExecutable
69 },
72 hex_to_id("0000000000000000000000000000000000000000")70 hex_to_id("0000000000000000000000000000000000000000")
73 ),71 ),
74 (72 (
@@ -78,7 +76,7 @@ mod from_tree { · 3 unmodified lines
78 ),76 ),
79 (77 (
80 "extra-dir/symlink-to-extra".into(),78 "extra-dir/symlink-to-extra".into(),
81 expected_link_mode,79 EntryKind::Link,
82 hex_to_id("0000000000000000000000000000000000000000")80 hex_to_id("0000000000000000000000000000000000000000")
83 )81 )
84 ]82 ]
@@ -111,20 +109,23 @@ mod from_tree { · 26 unmodified lines
111 header.mode()?,109 header.mode()?,
112 ));110 ));
113 }111 }
114 let expected_symlink_type = EntryType::Symlink;
115 let expected_exe_mode = if cfg!(windows) { 420 } else { 493 };
116 assert_eq!(112 assert_eq!(
117 out,113 out,
118 [114 [
119 ("prefix/.gitattributes", EntryType::Regular, 56, 420),115 ("prefix/.gitattributes", EntryType::Regular, 56, 420),
120 ("prefix/a", EntryType::Regular, 3, 420),116 ("prefix/a", EntryType::Regular, 3, 420),
121 ("prefix/symlink-to-a", expected_symlink_type, 0, 420),117 ("prefix/symlink-to-a", EntryType::Symlink, 0, 420),
122 ("prefix/dir/b", EntryType::Regular, 3, 420),118 ("prefix/dir/b", EntryType::Regular, 3, 420),
123 ("prefix/dir/subdir/exe", EntryType::Regular, 0, expected_exe_mode),119 ("prefix/dir/subdir/exe", EntryType::Regular, 0, 493),
124 ("prefix/extra-file", EntryType::Regular, 21, 420),120 ("prefix/extra-file", EntryType::Regular, 21, 420),
125 ("prefix/extra-exe", EntryType::Regular, 0, expected_exe_mode),121 (
122 "prefix/extra-exe",
123 EntryType::Regular,
124 0,
125 if cfg!(windows) { 420 } else { 493 }
126 ),
126 ("prefix/extra-dir-empty", EntryType::Directory, 0, 420),127 ("prefix/extra-dir-empty", EntryType::Directory, 0, 420),
127 ("prefix/extra-dir/symlink-to-extra", expected_symlink_type, 0, 420)128 ("prefix/extra-dir/symlink-to-extra", EntryType::Symlink, 0, 420)
128 ]129 ]
129 .into_iter()130 .into_iter()
130 .map(|(path, b, c, d)| (bstr::BStr::new(path).to_owned(), b, c, d))131 .map(|(path, b, c, d)| (bstr::BStr::new(path).to_owned(), b, c, d))
gix-archive/tests/fixtures/basic.sh+1−1
@@ -20,6 +20,7 @@ echo "/dir-ignored/ export-ignore" > .gitattributes · 19 unmodified lines
20echo "/file-ignored export-ignore" >> .gitattributes20echo "/file-ignored export-ignore" >> .gitattributes
21 21
22git add .22git add .
23git update-index --chmod=+x dir/subdir/exe # For Windows.
23git commit -m "init"24git commit -m "init"
24 25
25echo "extra to be streamed" > extra-file26echo "extra to be streamed" > extra-file
@@ -28,4 +29,3 @@ mkdir extra-dir-empty extra-dir · 2 unmodified lines
28ln -s ../extra-file extra-dir/symlink-to-extra29ln -s ../extra-file extra-dir/symlink-to-extra
29 30
30git rev-parse @^{tree} > head.hex31git rev-parse @^{tree} > head.hex
31
gix-dir/tests/fixtures/many-symlinks.sh+3−4
@@ -1,8 +1,7 @@
1#!/usr/bin/env bash1#!/usr/bin/env bash
2set -eu -o pipefail2set -eu -o pipefail
3 3
4# Note that symlink creation fails on Windows for some reason,4# These fixtures use symlinks. See `many.sh` for some that don't.
5# so these tests shouldn't be run there.
6 5
7git init breakout-symlink6git init breakout-symlink
8(cd breakout-symlink7(cd breakout-symlink
@@ -20,7 +19,7 @@ git init immediate-breakout-symlink · 11 unmodified lines
20 19
21git init excluded-symlinks-to-dir20git init excluded-symlinks-to-dir
22(cd excluded-symlinks-to-dir21(cd excluded-symlinks-to-dir
23 cat <<EOF >.gitignore22 cat <<'EOF' >.gitignore
24src123src1
25src2/24src2/
26file125file1
@@ -42,4 +41,4 @@ EOF · 15 unmodified lines
42 ln -s src/file file241 ln -s src/file file2
43)42)
44 43
45ln -s excluded-symlinks-to-dir worktree-root-is-symlink44ln -s excluded-symlinks-to-dir worktree-root-is-symlink
gix-dir/tests/fixtures/many.sh+1−1
@@ -1,7 +1,7 @@
1#!/usr/bin/env bash1#!/usr/bin/env bash
2set -eu -o pipefail2set -eu -o pipefail
3 3
4# Nothing here may use symlinks so these fixtures can be used on windows as well.4# These fixtures don't use symlinks. See `many-symlinks.sh` for some that do.
5 5
6git init with-nested-dot-git6git init with-nested-dot-git
7(cd with-nested-dot-git7(cd with-nested-dot-git
gix-dir/tests/walk/mod.rs+0−4
@@ -19,7 +19,6 @@ use gix_dir::walk::ForDeletionMode; · 18 unmodified lines
19use gix_ignore::Kind::*;19use gix_ignore::Kind::*;
20 20
21#[test]21#[test]
22#[cfg_attr(windows, ignore = "symlinks the way they are organized don't yet work on windows")]
23fn symlink_to_dir_can_be_excluded() -> crate::Result {22fn symlink_to_dir_can_be_excluded() -> crate::Result {
24 let root = fixture_in("many-symlinks", "excluded-symlinks-to-dir");23 let root = fixture_in("many-symlinks", "excluded-symlinks-to-dir");
25 let ((out, _root), entries) = collect(&root, None, |keep, ctx| {24 let ((out, _root), entries) = collect(&root, None, |keep, ctx| {
@@ -94,7 +93,6 @@ fn symlink_to_dir_can_be_excluded() -> crate::Result { · 68 unmodified lines
94}93}
95 94
96#[test]95#[test]
97#[cfg_attr(windows, ignore = "symlinks the way they are organized don't yet work on windows")]
98fn root_may_not_lead_through_symlinks() -> crate::Result {96fn root_may_not_lead_through_symlinks() -> crate::Result {
99 for (name, intermediate, expected) in [97 for (name, intermediate, expected) in [
100 ("immediate-breakout-symlink", "", 0),98 ("immediate-breakout-symlink", "", 0),
@@ -121,7 +119,6 @@ fn root_may_not_lead_through_symlinks() -> crate::Result { · 20 unmodified lines
121}119}
122 120
123#[test]121#[test]
124#[cfg_attr(windows, ignore = "symlinks the way they are organized don't yet work on windows")]
125fn root_may_be_a_symlink_if_it_is_the_worktree() -> crate::Result {122fn root_may_be_a_symlink_if_it_is_the_worktree() -> crate::Result {
126 let root = fixture_in("many-symlinks", "worktree-root-is-symlink");123 let root = fixture_in("many-symlinks", "worktree-root-is-symlink");
127 let ((_out, _root), entries) = collect(&root, None, |keep, ctx| {124 let ((_out, _root), entries) = collect(&root, None, |keep, ctx| {
@@ -2702,7 +2699,6 @@ fn decomposed_unicode_in_directory_is_returned_precomposed() -> crate::Result { · 2574 unmodified lines
2702}2699}
2703 2700
2704#[test]2701#[test]
2705#[cfg_attr(windows, ignore = "symlinks the way they are organized don't yet work on windows")]
2706fn worktree_root_can_be_symlink() -> crate::Result {2702fn worktree_root_can_be_symlink() -> crate::Result {
2707 let root = fixture_in("many-symlinks", "symlink-to-breakout-symlink");2703 let root = fixture_in("many-symlinks", "symlink-to-breakout-symlink");
2708 let troot = root.join("file");2704 let troot = root.join("file");
gix-index/tests/fixtures/generated-archives/v2_all_file_kinds.tar+0−0

Binary file not shown.

gix-index/tests/fixtures/make_index/v2_all_file_kinds.sh+2−2
@@ -1,11 +1,10 @@
1#!/usr/bin/env bash1#!/usr/bin/env bash
2set -eu -o pipefail2set -eu -o pipefail
3 3
4export GIT_INDEX_VERSION=2;4export GIT_INDEX_VERSION=2
5 5
6git init -q sub6git init -q sub
7(cd sub7(cd sub
8
9 touch a b c8 touch a b c
10 git add .9 git add .
11 git commit -m "init"10 git commit -m "init"
@@ -21,6 +20,7 @@ mkdir d · 9 unmodified lines
21(cd d && touch a b c)20(cd d && touch a b c)
22 21
23git add .22git add .
23git update-index --chmod=+x b # For Windows.
24git commit -m "init"24git commit -m "init"
25 25
26git rev-parse @^{tree} > head.tree26git rev-parse @^{tree} > head.tree
gix-index/tests/fixtures/make_index/v2_deeper_tree.sh+2−1
@@ -1,7 +1,7 @@
1#!/usr/bin/env bash1#!/usr/bin/env bash
2set -eu -o pipefail2set -eu -o pipefail
3 3
4export GIT_INDEX_VERSION=2;4export GIT_INDEX_VERSION=2
5 5
6mkdir sub6mkdir sub
7(cd sub7(cd sub
@@ -25,4 +25,5 @@ mkdir d · 17 unmodified lines
25)25)
26 26
27git add .27git add .
28git update-index --chmod=+x b # For Windows.
28git commit -m "init"29git commit -m "init"
gix-merge/tests/fixtures/generated-archives/tree-baseline.tar+0−0

Binary file not shown.

gix-merge/tests/fixtures/tree-baseline.sh+6−6
@@ -475,8 +475,8 @@ git init same-rename-different-mode · 474 unmodified lines
475 475
476 git checkout A476 git checkout A
477 write_lines 1 2 3 4 5 >a/x.f477 write_lines 1 2 3 4 5 >a/x.f
478 chmod +x a/x.f478 chmod +x a/x.f a/w
479 chmod +x a/w479 git update-index --chmod=+x a/x.f a/w
480 git mv a a-renamed480 git mv a a-renamed
481 git commit -am "changed all content, add +x, renamed a -> a-renamed"481 git commit -am "changed all content, add +x, renamed a -> a-renamed"
482 482
@@ -486,8 +486,8 @@ git init same-rename-different-mode · 3 unmodified lines
486 git commit -am "changed all content, renamed a -> a-renamed"486 git commit -am "changed all content, renamed a -> a-renamed"
487 487
488 git checkout expected488 git checkout expected
489 chmod +x a/x.f489 chmod +x a/x.f a/w
490 chmod +x a/w490 git update-index --chmod=+x a/x.f a/w
491 write_lines 1 2 3 4 5 6 >a/x.f491 write_lines 1 2 3 4 5 6 >a/x.f
492 git mv a a-renamed492 git mv a a-renamed
493 git commit -am "Git, when branches are reversed, doesn't keep the +x flag on a/w so we specify our own expectation"493 git commit -am "Git, when branches are reversed, doesn't keep the +x flag on a/w so we specify our own expectation"
@@ -530,13 +530,13 @@ git init added-file-changed-content-and-mode · 36 unmodified lines
530 git checkout B530 git checkout B
531 write_lines original 1 2 3 4 5 6 >new531 write_lines original 1 2 3 4 5 6 >new
532 chmod +x new532 chmod +x new
533 git add .533 git add --chmod=+x new
534 git commit -m "add new with content B and +x"534 git commit -m "add new with content B and +x"
535 535
536 git checkout expected536 git checkout expected
537 echo -n $'<<<<<<< A\n1\n2\n3\n4\n5\n=======\noriginal\n1\n2\n3\n4\n5\n6\n>>>>>>> B\n' >new537 echo -n $'<<<<<<< A\n1\n2\n3\n4\n5\n=======\noriginal\n1\n2\n3\n4\n5\n6\n>>>>>>> B\n' >new
538 chmod +x new538 chmod +x new
539 git add new539 git add --chmod=+x new
540 git commit -m "Git has a better merge here, but that's due to better hunk handling/hunk splitting. We, however, consistently use +x"540 git commit -m "Git has a better merge here, but that's due to better hunk handling/hunk splitting. We, however, consistently use +x"
541)541)
542 542
gix-status/tests/fixtures/generated-archives/status_many.tar+0−0

Binary file not shown.

gix-status/tests/fixtures/generated-archives/status_removed.tar+0−0

Binary file not shown.

gix-status/tests/fixtures/status_changed.sh+2−1
@@ -14,6 +14,7 @@ mkdir dir/sub-dir · 13 unmodified lines
14(cd dir/sub-dir && ln -sf ../content symlink)14(cd dir/sub-dir && ln -sf ../content symlink)
15 15
16git add -A16git add -A
17git update-index --chmod=+x executable # For Windows.
17git commit -m "Commit"18git commit -m "Commit"
18 19
19chmod +x dir/content20chmod +x dir/content
@@ -23,4 +24,4 @@ echo -n "foo" > executable · 3 unmodified lines
23 24
24rm empty25rm empty
25ln -sf dir/content empty26ln -sf dir/content empty
26git reset 27git reset
gix-status/tests/fixtures/status_many.sh+1−0
@@ -12,6 +12,7 @@ git init -q changed-and-untracked · 11 unmodified lines
12 echo "different content" > dir/content212 echo "different content" > dir/content2
13 13
14 git add -A14 git add -A
15 git update-index --chmod=+x executable # For Windows.
15 git commit -m "Commit"16 git commit -m "Commit"
16 echo "change" >> executable17 echo "change" >> executable
17 18
gix-status/tests/fixtures/status_removed.sh+2−1
@@ -13,6 +13,7 @@ mkdir dir/sub-dir · 12 unmodified lines
13(cd dir/sub-dir && ln -sf ../content symlink)13(cd dir/sub-dir && ln -sf ../content symlink)
14 14
15git add -A15git add -A
16git update-index --chmod=+x executable # For Windows.
16git commit -m "Commit"17git commit -m "Commit"
17rm -rf ./empty ./executable ./dir/content ./dir/sub-dir/symlink18rm -rf ./empty ./executable ./dir/content ./dir/sub-dir/symlink
18git reset 19git reset
gix-status/tests/fixtures/status_unchanged.sh+2−1
@@ -13,8 +13,9 @@ mkdir dir/sub-dir · 12 unmodified lines
13(cd dir/sub-dir && ln -sf ../content symlink)13(cd dir/sub-dir && ln -sf ../content symlink)
14 14
15git add -A15git add -A
16git update-index --chmod=+x executable # For Windows.
16git commit -m "Commit"17git commit -m "Commit"
17 18
18touch ./empty ./executable ./dir/content ./dir/sub-dir/symlink19touch ./empty ./executable ./dir/content ./dir/sub-dir/symlink
19 20
20git reset # ensure index timestamp is large enough to not mark everything racy21git reset # ensure index timestamp is large enough to not mark everything racy
gix-worktree-state/tests/fixtures/make_mixed.sh+1−0
@@ -17,6 +17,7 @@ mkdir dir/sub-dir · 16 unmodified lines
17(cd dir/sub-dir && ln -sf ../content symlink)17(cd dir/sub-dir && ln -sf ../content symlink)
18 18
19git add -A19git add -A
20git update-index --chmod=+x executable # For Windows.
20git commit -m "Commit"21git commit -m "Commit"
21 22
22git init module123git init module1
gix-worktree-state/tests/fixtures/make_mixed_without_submodules.sh+1−0
@@ -17,4 +17,5 @@ mkdir dir/sub-dir · 16 unmodified lines
17(cd dir/sub-dir && ln -sf ../content symlink)17(cd dir/sub-dir && ln -sf ../content symlink)
18 18
19git add -A19git add -A
20git update-index --chmod=+x executable # For Windows.
20git commit -m "Commit"21git commit -m "Commit"
gix-worktree-state/tests/fixtures/make_mixed_without_submodules_and_symlinks.sh+1−0
@@ -17,4 +17,5 @@ mkdir dir/sub-dir · 16 unmodified lines
17echo "even other content" > dir/sub-dir/file17echo "even other content" > dir/sub-dir/file
18 18
19git add -A19git add -A
20git update-index --chmod=+x executable # For Windows.
20git commit -m "Commit"21git commit -m "Commit"
gix-worktree-state/tests/state/checkout.rs+4−18
@@ -173,20 +173,13 @@ fn delayed_driver_process() -> crate::Result { · 172 unmodified lines
173}173}
174 174
175#[test]175#[test]
176#[cfg_attr(
177 windows,
178 ignore = "on windows, the symlink to a directory doesn't seem to work and we really want to test with symlinks"
179)]
180fn overwriting_files_and_lone_directories_works() -> crate::Result {176fn overwriting_files_and_lone_directories_works() -> crate::Result {
181 for delay in [177 for delay in [
182 gix_filter::driver::apply::Delay::Allow,178 gix_filter::driver::apply::Delay::Allow,
183 gix_filter::driver::apply::Delay::Forbid,179 gix_filter::driver::apply::Delay::Forbid,
184 ] {180 ] {
185 let mut opts = opts_from_probe();181 let mut opts = opts_from_probe();
186 assert!(182 assert!(opts.fs.symlink, "The probe must detect to be able to generate symlinks");
187 opts.fs.symlink,
188 "BUG: the probe must detect to be able to generate symlinks"
189 );
190 opts.overwrite_existing = true;183 opts.overwrite_existing = true;
191 opts.filter_process_delay = delay;184 opts.filter_process_delay = delay;
192 opts.destination_is_initially_empty = false;185 opts.destination_is_initially_empty = false;
@@ -244,8 +237,7 @@ fn overwriting_files_and_lone_directories_works() -> crate::Result { · 51 unmodified lines
244 );237 );
245 238
246 let symlink = destination.path().join("dir/sub-dir/symlink");239 let symlink = destination.path().join("dir/sub-dir/symlink");
247 // on windows, git won't create symlinks as its probe won't detect the capability, even though we do.240 assert!(std::fs::symlink_metadata(&symlink)?.is_symlink());
248 assert_eq!(std::fs::symlink_metadata(&symlink)?.is_symlink(), cfg!(unix));
249 assert_eq!(241 assert_eq!(
250 std::fs::read(symlink)?.as_bstr(),242 std::fs::read(symlink)?.as_bstr(),
251 "➡other content\r\n",243 "➡other content\r\n",
@@ -270,10 +262,7 @@ fn symlinks_become_files_if_disabled() -> crate::Result { · 18 unmodified lines
270#[test]262#[test]
271fn symlinks_to_directories_are_usable() -> crate::Result {263fn symlinks_to_directories_are_usable() -> crate::Result {
272 let opts = opts_from_probe();264 let opts = opts_from_probe();
273 if !opts.fs.symlink {265 assert!(opts.fs.symlink, "The probe must detect to be able to generate symlinks");
274 eprintln!("Skipping directory symlink test on filesystem that doesn't support it");
275 return Ok(());
276 }
277 266
278 let (_source_tree, destination, _index, outcome) =267 let (_source_tree, destination, _index, outcome) =
279 checkout_index_in_tmp_dir(opts.clone(), "make_dir_symlink", None)?;268 checkout_index_in_tmp_dir(opts.clone(), "make_dir_symlink", None)?;
@@ -298,10 +287,7 @@ fn symlinks_to_directories_are_usable() -> crate::Result { · 18 unmodified lines
298#[test]287#[test]
299fn dangling_symlinks_can_be_created() -> crate::Result {288fn dangling_symlinks_can_be_created() -> crate::Result {
300 let opts = opts_from_probe();289 let opts = opts_from_probe();
301 if !opts.fs.symlink {290 assert!(opts.fs.symlink, "The probe must detect to be able to generate symlinks");
302 eprintln!("Skipping dangling symlink test on filesystem that doesn't support it");
303 return Ok(());
304 }
305 291
306 for (fixture, symlink_name, target_name) in [292 for (fixture, symlink_name, target_name) in [
307 ("make_dangling_symlink", "dangling", "non-existing-target"),293 ("make_dangling_symlink", "dangling", "non-existing-target"),
gix-worktree-stream/tests/fixtures/basic.sh+1−1
@@ -23,6 +23,7 @@ echo "/file-ignored export-ignore" >> .gitattributes · 22 unmodified lines
23dd if=/dev/zero of=bigfile bs=1024 count=15623dd if=/dev/zero of=bigfile bs=1024 count=156
24 24
25git add .25git add .
26git update-index --chmod=+x dir/subdir/exe
26git commit -m "init"27git commit -m "init"
27 28
28echo "extra" > extra-file29echo "extra" > extra-file
@@ -32,4 +33,3 @@ ln -s ../extra-file extra-dir/symlink-to-extra · 3 unmodified lines
32dd if=/dev/zero of=extra-bigfile bs=1024 count=15633dd if=/dev/zero of=extra-bigfile bs=1024 count=156
33 34
34git rev-parse @^{tree} > head.hex35git rev-parse @^{tree} > head.hex
35
gix-worktree-stream/tests/stream.rs+8−10
@@ -110,12 +110,6 @@ mod from_tree { · 109 unmodified lines
110 }110 }
111 }111 }
112 112
113 let expected_exe_mode = if cfg!(windows) {
114 EntryKind::Blob
115 } else {
116 EntryKind::BlobExecutable
117 };
118 let expected_link_mode = EntryKind::Link;
119 assert_eq!(113 assert_eq!(
120 paths_and_modes,114 paths_and_modes,
121 &[115 &[
@@ -136,7 +130,7 @@ mod from_tree { · 14 unmodified lines
136 ),130 ),
137 (131 (
138 "symlink-to-a".into(),132 "symlink-to-a".into(),
139 expected_link_mode,133 EntryKind::Link,
140 hex_to_id("2e65efe2a145dda7ee51d1741299f848e5bf752e")134 hex_to_id("2e65efe2a145dda7ee51d1741299f848e5bf752e")
141 ),135 ),
142 (136 (
@@ -151,7 +145,7 @@ mod from_tree { · 8 unmodified lines
151 ),145 ),
152 (146 (
153 "dir/subdir/exe".into(),147 "dir/subdir/exe".into(),
154 expected_exe_mode,148 EntryKind::BlobExecutable,
155 hex_to_id("e69de29bb2d1d6434b8b29ae775ad8c2e48c5391")149 hex_to_id("e69de29bb2d1d6434b8b29ae775ad8c2e48c5391")
156 ),150 ),
157 (151 (
@@ -171,7 +165,11 @@ mod from_tree { · 13 unmodified lines
171 ),165 ),
172 (166 (
173 "extra-exe".into(),167 "extra-exe".into(),
174 expected_exe_mode,168 if cfg!(windows) {
169 EntryKind::Blob
170 } else {
171 EntryKind::BlobExecutable
172 },
175 hex_to_id("0000000000000000000000000000000000000000")173 hex_to_id("0000000000000000000000000000000000000000")
176 ),174 ),
177 (175 (
@@ -181,7 +179,7 @@ mod from_tree { · 3 unmodified lines
181 ),179 ),
182 (180 (
183 "extra-dir/symlink-to-extra".into(),181 "extra-dir/symlink-to-extra".into(),
184 expected_link_mode,182 EntryKind::Link,
185 hex_to_id("0000000000000000000000000000000000000000")183 hex_to_id("0000000000000000000000000000000000000000")
186 )184 )
187 ]185 ]
gix/tests/fixtures/generated-archives/make_rev_spec_parse_repos.tar+0−0

Binary file not shown.

gix/tests/fixtures/make_rev_spec_parse_repos.sh+3−3
@@ -53,8 +53,8 @@ git init --bare blob.corrupt · 52 unmodified lines
53 echo bnkxmdwz | git hash-object -w --stdin53 echo bnkxmdwz | git hash-object -w --stdin
54 oid=$(echo bmwsjxzi | git hash-object -w --stdin)54 oid=$(echo bmwsjxzi | git hash-object -w --stdin)
55 oidf=objects/$(oid_to_path "$oid")55 oidf=objects/$(oid_to_path "$oid")
56 chmod 755 $oidf56 chmod -- 644 "$oidf"
57 echo broken >$oidf57 echo broken >"$oidf"
58 58
59 baseline "cafea"59 baseline "cafea"
60 baseline "cafea^{object}"60 baseline "cafea^{object}"
@@ -424,4 +424,4 @@ git init invalid-head · 363 unmodified lines
424 rm .git/refs/heads/main424 rm .git/refs/heads/main
425 baseline 'HEAD'425 baseline 'HEAD'
426 baseline 'HEAD:file'426 baseline 'HEAD:file'
427)427)