Skip to content

Commit 40a4840

Browse files
committed
[book] Prevent over-matching in gitignore rule
To only ignore the output destination (default: `book`) and no other file/directory with the same name under the mdbook root, we should prefix the gitignore rule with a leading slash (default: `/book`).
1 parent 313f9b9 commit 40a4840

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/book/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,7 @@ impl MDBook {
223223

224224
debug!("[*]: Writing to .gitignore");
225225

226-
writeln!(f, "{}", relative).expect("Could not write to file.");
226+
writeln!(f, "/{}", relative).expect("Could not write to file.");
227227
}
228228
}
229229

0 commit comments

Comments
 (0)