     ;; 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)))
+    (when (apply 'git-call-process-display-error "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."

;;
;; TODO
;;  - portability to XEmacs
;;  - better handling of subprocess errors
;;  - diff against other branch
;;  - renaming files from the status buffer
;;  - creating tags

    (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."
