               (if (file-directory-p name)
                   (delete-directory name)
                 (delete-file name))))
-          (apply #'git-call-process-env nil nil "update-index" "--remove" "--" files)
-          (git-update-status-files files nil)
-          (git-success-message "Removed" files))
+          (when (apply 'git-call-process-display-error "update-index" "--remove" "--" files)
+            (git-update-status-files files nil)
+            (git-success-message "Removed" files)))
       (message "Aborting"))))
 
 (defun git-revert-file ()

    ;; FIXME: add support for directories
    (unless files
      (push (file-relative-name (read-file-name "File to add: " nil nil t)) files))
    (apply #'git-call-process-env nil nil "update-index" "--add" "--" files)
    (git-update-status-files files 'uptodate)
    (git-success-message "Added" files)))

(defun git-ignore-file ()
  "Add marked file(s) to the ignore list."

  (when (git-empty-db-p) (error "No commit to amend."))
  (let* ((commit (git-rev-parse "HEAD"))
         (files (git-get-commit-files commit)))
    (when (git-call-process-display-error "reset" "--soft" "HEAD^")
      (git-update-status-files (copy-sequence files) 'uptodate)
      (git-mark-files git-status files)
      (git-refresh-files)
      (git-setup-commit-buffer commit)
      (git-commit-file))))

(defun git-find-file ()
  "Visit the current file in its own buffer."
