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 that symlinks to directories are usable
At least as `std::fs::metdata` currently works on Windows, this entails that symlinks to directories on Windows are created as directory symlinks rather than as file symlinks (since file symlinks cannot always be automatically dereferenced, and accessing metadata via the `stat`-like `std::fs::metadata` function is one situation where that cannot be done).
- Loading branch information
1 parent
cf9e727
commit 93c5b8f
Showing
2 changed files
with
40 additions
and
0 deletions.
There are no files selected for viewing
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,12 @@ | ||
#!/usr/bin/env bash | ||
set -eu -o pipefail | ||
|
||
git init -q | ||
|
||
target_oid=$(echo -n "." | git hash-object -w --stdin) | ||
|
||
git update-index --index-info <<EOF | ||
120000 $target_oid symlink | ||
EOF | ||
|
||
git commit -m "symlink in index, points to directory" |
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