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.
Merge pull request GitoxideLabs#1425 from EliahKagan/strange-symlink-…
…targets Always fall back to creating file symlinks on Windows
- Loading branch information
Showing
10 changed files
with
87 additions
and
12 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
Empty file.
Binary file added
BIN
+59.5 KB
...tree-state/tests/fixtures/generated-archives/make_dangling_symlink_to_windows_invalid.tar
Binary file not shown.
Binary file added
BIN
+59.5 KB
...ree-state/tests/fixtures/generated-archives/make_dangling_symlink_to_windows_reserved.tar
Binary file not shown.
Binary file added
BIN
+59.5 KB
gix-worktree-state/tests/fixtures/generated-archives/make_dir_symlink.tar
Binary file not shown.
Empty file.
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
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