forked from GitoxideLabs/gitoxide
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Test symlinks to invalid and reserved Windows targets
These are effectively special cases of dangling symlinks. They should be treated the same as ordinary dangling symlinks, but the error kind isn't NotFound for these, so currently they are not created. The new tests should pass once that is fixed. See GitoxideLabs#1420.
- Loading branch information
1 parent
a91ac94
commit 69f3c5b
Showing
3 changed files
with
74 additions
and
0 deletions.
There are no files selected for viewing
13 changes: 13 additions & 0 deletions
13
gix-worktree-state/tests/fixtures/make_dangling_symlink_to_windows_invalid.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
#!/usr/bin/env bash | ||
set -eu -o pipefail | ||
|
||
git init -q | ||
|
||
# On Windows, the target is an invalid file name. | ||
qmarks_oid=$(echo -n "???" | git hash-object -w --stdin) | ||
|
||
git update-index --index-info <<EOF | ||
120000 $qmarks_oid dangling-qmarks-symlink | ||
EOF | ||
|
||
git commit -m "dangling symlinks with Windows invalid target in index" |
13 changes: 13 additions & 0 deletions
13
gix-worktree-state/tests/fixtures/make_dangling_symlink_to_windows_reserved.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
#!/usr/bin/env bash | ||
set -eu -o pipefail | ||
|
||
git init -q | ||
|
||
# On Windows, the target is a reserved legacy DOS device name. | ||
con_oid=$(echo -n "CON" | git hash-object -w --stdin) | ||
|
||
git update-index --index-info <<EOF | ||
120000 $con_oid dangling-con-symlink | ||
EOF | ||
|
||
git commit -m "dangling symlinks with Widnows reserved target in index" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters