Make magit-ignore-file work even if .gitignore doesn't exist.

This commit is contained in:
Nathan Weizenbaum 2010-06-09 15:48:04 -07:00
parent 5744d3ec98
commit 25b4bf7e6e
2 changed files with 3 additions and 2 deletions

View file

@ -3804,7 +3804,8 @@ level commits."
(if edit (if edit
(setq file (read-string "File to ignore: " file))) (setq file (read-string "File to ignore: " file)))
(with-temp-buffer (with-temp-buffer
(insert-file-contents ignore-file) (when (file-exists-p ignore-file)
(insert-file-contents ignore-file))
(goto-char (point-max)) (goto-char (point-max))
(unless (bolp) (unless (bolp)
(insert "\n")) (insert "\n"))

View file

@ -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 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 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 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 only push the current branch to the remote. In other words, it will
run @code{git push <remote> <branch>}. run @code{git push <remote> <branch>}.