-
-
Notifications
You must be signed in to change notification settings - Fork 29
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: don't read .gitignore from above the git root (#458)
Also, only read .gitignore from git directories. Release 24.11.2 Fixes #450
- Loading branch information
Showing
9 changed files
with
115 additions
and
46 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
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
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
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
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,14 @@ | ||
use std::fs::FileType; | ||
|
||
use anyhow::Context; | ||
use camino::Utf8Path; | ||
|
||
use crate::Result; | ||
|
||
pub(super) fn copy_symlink(_ft: FileType, src_path: &Utf8Path, dest_path: &Utf8Path) -> Result<()> { | ||
let link_target = std::fs::read_link(src_path) | ||
.with_context(|| format!("Failed to read link {src_path:?}"))?; | ||
std::os::unix::fs::symlink(link_target, dest_path) | ||
.with_context(|| format!("Failed to create symlink {dest_path:?}",))?; | ||
Ok(()) | ||
} |
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,22 @@ | ||
use std::fs::FileType; | ||
use std::os::windows::fs::FileTypeExt; | ||
|
||
use anyhow::Context; | ||
use camino::Utf8Path; | ||
|
||
use crate::Result; | ||
#[mutants::skip] // Mutant tests run on Linux | ||
pub(super) fn copy_symlink(ft: FileType, src_path: &Utf8Path, dest_path: &Utf8Path) -> Result<()> { | ||
let link_target = | ||
std::fs::read_link(src_path).with_context(|| format!("read link {src_path:?}"))?; | ||
if ft.is_symlink_dir() { | ||
std::os::windows::fs::symlink_dir(link_target, dest_path) | ||
.with_context(|| format!("create symlink {dest_path:?}"))?; | ||
} else if ft.is_symlink_file() { | ||
std::os::windows::fs::symlink_file(link_target, dest_path) | ||
.with_context(|| format!("create symlink {dest_path:?}"))?; | ||
} else { | ||
anyhow::bail!("Unknown symlink type: {:?}", ft); | ||
} | ||
Ok(()) | ||
} |
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
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