From 25b4bf7e6ec8d8598820ec59e203978f6261ebf1 Mon Sep 17 00:00:00 2001 From: Nathan Weizenbaum Date: Wed, 9 Jun 2010 15:48:04 -0700 Subject: [PATCH] Make magit-ignore-file work even if .gitignore doesn't exist. --- magit.el | 3 ++- magit.texi | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/magit.el b/magit.el index c03ad68d..21f497e5 100644 --- a/magit.el +++ b/magit.el @@ -3804,7 +3804,8 @@ level commits." (if edit (setq file (read-string "File to ignore: " file))) (with-temp-buffer - (insert-file-contents ignore-file) + (when (file-exists-p ignore-file) + (insert-file-contents ignore-file)) (goto-char (point-max)) (unless (bolp) (insert "\n")) diff --git a/magit.texi b/magit.texi index 5955aa6b..98c7feb2 100644 --- a/magit.texi +++ b/magit.texi @@ -649,7 +649,7 @@ it, like from any other diff. Magit will run @code{git push} when you type @kbd{P}. If you give a prefix argument to @kbd{P}, you will be prompted for the repository to -push to. When no default remote repositor has been configured yet for +push to. When no default remote repository has been configured yet for the current branch, you will be prompted as well. Typing @kbd{P} will only push the current branch to the remote. In other words, it will run @code{git push }.