From 40a4840867d10e147881f107bc19427d02b04faf Mon Sep 17 00:00:00 2001 From: Behnam Esfahbod Date: Wed, 30 Aug 2017 16:01:43 -0700 Subject: [PATCH] [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`). --- src/book/mod.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/book/mod.rs b/src/book/mod.rs index 437b13d1..e8896e0a 100644 --- a/src/book/mod.rs +++ b/src/book/mod.rs @@ -223,7 +223,7 @@ impl MDBook { debug!("[*]: Writing to .gitignore"); - writeln!(f, "{}", relative).expect("Could not write to file."); + writeln!(f, "/{}", relative).expect("Could not write to file."); } }