Skip to content

Commit d03971b

Browse files
committed
Enable gix-dir walk symlink tests even on Windows
As detailed in d715e4a, most tests involving symlinks have been expected to work even on Windows since #1444, but some tests remain to be updated to be run on Windows or to include all symlink-related asertions on Windows. This includes 4 tests in `gix-dir/tests/walk/mod.rs`, which were ignored on Windows even though they are able to pass. This commit enables them on Windows. It also updates the associated fixture scripts to no longer say that symlink test can't run on Windows. But no changes to the fixture scripts are required for the tests to pass. (While doing so, I've made a small change, adding quoting to a here document delimiter to make clear that no expansions are intended to occur in the here document text. But this change is purely for clarity; nothing was broken in connection with that heredoc.)
1 parent d74e919 commit d03971b

File tree

3 files changed

+4
-9
lines changed

3 files changed

+4
-9
lines changed

gix-dir/tests/fixtures/many-symlinks.sh

+3-4
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
#!/usr/bin/env bash
22
set -eu -o pipefail
33

4-
# Note that symlink creation fails on Windows for some reason,
5-
# so these tests shouldn't be run there.
4+
# These fixtures use symlinks. See `many.sh` for some that don't.
65

76
git init breakout-symlink
87
(cd breakout-symlink
@@ -20,7 +19,7 @@ git init immediate-breakout-symlink
2019

2120
git init excluded-symlinks-to-dir
2221
(cd excluded-symlinks-to-dir
23-
cat <<EOF >.gitignore
22+
cat <<'EOF' >.gitignore
2423
src1
2524
src2/
2625
file1
@@ -42,4 +41,4 @@ EOF
4241
ln -s src/file file2
4342
)
4443

45-
ln -s excluded-symlinks-to-dir worktree-root-is-symlink
44+
ln -s excluded-symlinks-to-dir worktree-root-is-symlink

gix-dir/tests/fixtures/many.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#!/usr/bin/env bash
22
set -eu -o pipefail
33

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.
55

66
git init with-nested-dot-git
77
(cd with-nested-dot-git

gix-dir/tests/walk/mod.rs

-4
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ use gix_dir::walk::ForDeletionMode;
1919
use gix_ignore::Kind::*;
2020

2121
#[test]
22-
#[cfg_attr(windows, ignore = "symlinks the way they are organized don't yet work on windows")]
2322
fn symlink_to_dir_can_be_excluded() -> crate::Result {
2423
let root = fixture_in("many-symlinks", "excluded-symlinks-to-dir");
2524
let ((out, _root), entries) = collect(&root, None, |keep, ctx| {
@@ -94,7 +93,6 @@ fn symlink_to_dir_can_be_excluded() -> crate::Result {
9493
}
9594

9695
#[test]
97-
#[cfg_attr(windows, ignore = "symlinks the way they are organized don't yet work on windows")]
9896
fn root_may_not_lead_through_symlinks() -> crate::Result {
9997
for (name, intermediate, expected) in [
10098
("immediate-breakout-symlink", "", 0),
@@ -121,7 +119,6 @@ fn root_may_not_lead_through_symlinks() -> crate::Result {
121119
}
122120

123121
#[test]
124-
#[cfg_attr(windows, ignore = "symlinks the way they are organized don't yet work on windows")]
125122
fn root_may_be_a_symlink_if_it_is_the_worktree() -> crate::Result {
126123
let root = fixture_in("many-symlinks", "worktree-root-is-symlink");
127124
let ((_out, _root), entries) = collect(&root, None, |keep, ctx| {
@@ -2702,7 +2699,6 @@ fn decomposed_unicode_in_directory_is_returned_precomposed() -> crate::Result {
27022699
}
27032700

27042701
#[test]
2705-
#[cfg_attr(windows, ignore = "symlinks the way they are organized don't yet work on windows")]
27062702
fn worktree_root_can_be_symlink() -> crate::Result {
27072703
let root = fixture_in("many-symlinks", "symlink-to-breakout-symlink");
27082704
let troot = root.join("file");

0 commit comments

Comments
 (0)