emulate append-to-file, because it doesn't work over tramp

This commit is contained in:
Alexey Voinov 2010-03-12 18:06:13 +03:00 committed by Rémi Vanicat
parent 3d2321b317
commit 7ca25460fa

View file

@ -3129,7 +3129,11 @@ Prefix arg means justify as well."
(let ((ignore-file (if local ".git/info/exclude" ".gitignore")))
(if edit
(setq file (read-string "File to ignore: " file)))
(append-to-file (concat "/" file "\n") nil ignore-file)
(with-temp-buffer
(insert-file-contents ignore-file)
(goto-char (point-max))
(insert "/" file "\n")
(write-region nil nil ignore-file))
(magit-need-refresh)))
(defun magit-ignore-item ()