diff options
| -rw-r--r-- | lisp/magit-gitignore.el | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/lisp/magit-gitignore.el b/lisp/magit-gitignore.el index dc53383..e685b82 100644 --- a/lisp/magit-gitignore.el +++ b/lisp/magit-gitignore.el @@ -112,6 +112,11 @@ Rules that are defined in that file affect all local repositories." (let ((choices (magit--gitignore-patterns directory)) (default (magit-current-file))) (when default + (when directory + (setq default + (substring default + (length + (file-relative-name directory (magit-toplevel)))))) (setq default (concat "/" default)) (unless (member default choices) (setq default (concat "*." (file-name-extension default))) |
