       (apply #'call-process "env" nil buffer nil
              (append (git-get-env-strings env) (list "git") args))
     (apply #'call-process "git" nil buffer nil args)))
+
+(defun git-call-process-display-error (&rest args)
+  "Wrapper for call-process that displays error messages."
+  (let* ((dir default-directory)
+         (buffer (get-buffer-create "*Git Command Output*"))
+         (ok (with-current-buffer buffer
+               (let ((default-directory dir)
+                     (buffer-read-only nil))
+                 (erase-buffer)
+                 (eq 0 (apply 'call-process "git" nil (list buffer t) nil args))))))
+    (unless ok (display-message-or-buffer buffer))
+    ok))
 
 (defun git-call-process-env-string (env &rest args)
   "Wrapper for call-process that sets environment strings,

    ;; 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 reason
     (push reason args)
     (push "-m" args))
    (apply 'git-call-process-display-error "update-ref" args)))

(defun git-read-tree (tree &optional index-file)
  "Read a tree into the index file."
