Skip to contentSkip to conversation

git.el: Prepend a slash to the file name when adding to .gitignore.

PATCH In review Alexandre Julliard 1 participant 1 message Jun 15, 2016

lore
Share & tools
lore
#0 lore raw

PATCH 2/4 git.el: Prepend a slash to the file name when adding to .gitignore.

This way the ignore command will really only ignore the marked files and not files with the same name in subdirectories.

---
 contrib/emacs/git.el |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
contrib/emacs/git.el +1 -1
index 7371d4b..5837471 100644
@@ -258,7 +258,7 @@ (defun git-append-to-ignore (file)
     (set-buffer (find-file-noselect ignore-name))
     (goto-char (point-max))
     (unless (zerop (current-column)) (insert "\n"))
-    (insert name "\n")
+    (insert "/" name "\n")
     (sort-lines nil (point-min) (point-max))
     (save-buffer))
   (when created
Signature · 5 lines
1.4.2.rc1.ge7a0

-- 
Alexandre Julliard
[email protected]