Actually skip .gitignore if --skip-git is passed to init (#1172)

This commit is contained in:
Micah
2025-11-26 13:59:12 -08:00
committed by GitHub
parent 93e9c51204
commit a99e877b7c
2 changed files with 8 additions and 2 deletions

View File

@@ -80,8 +80,12 @@ impl InitCommand {
} else {
let content = vfs.read_to_string_lf_normalized(&path)?;
if let Some(file_stem) = path.file_name().and_then(OsStr::to_str) {
if file_stem == GIT_IGNORE_PLACEHOLDER && !self.skip_git {
path.set_file_name(".gitignore");
if file_stem == GIT_IGNORE_PLACEHOLDER {
if self.skip_git {
continue;
} else {
path.set_file_name(".gitignore");
}
}
}
write_if_not_exists(