diff lisp/vc-git.el @ 93118:01d3fd1a2cfe

* vc-hg.el (vc-hg-state): * vc-git.el (vc-git-state): * vc-cvs.el (vc-cvs-parse-status): * vc-bzr.el (vc-bzr-state): Return 'added when the file is in that state.
author Dan Nicolaescu <dann@ics.uci.edu>
date Fri, 21 Mar 2008 05:53:48 +0000
parents a0193ceeaa83
children ab6a0ec29e00
line wrap: on
line diff
--- a/lisp/vc-git.el	Fri Mar 21 01:49:18 2008 +0000
+++ b/lisp/vc-git.el	Fri Mar 21 05:53:48 2008 +0000
@@ -146,9 +146,9 @@
   ;; FIXME: This can't set 'ignored yet
   (vc-git--call nil "add" "--refresh" "--" (file-relative-name file))
   (let ((diff (vc-git--run-command-string file "diff-index" "-z" "HEAD" "--")))
-    (if (and diff (string-match ":[0-7]\\{6\\} [0-7]\\{6\\} [0-9a-f]\\{40\\} [0-9a-f]\\{40\\} [ADMU]\0[^\0]+\0"
+    (if (and diff (string-match ":[0-7]\\{6\\} [0-7]\\{6\\} [0-9a-f]\\{40\\} [0-9a-f]\\{40\\} \\([ADMU]\\)\0[^\0]+\0"
                                 diff))
-        'edited
+	(if (string= (match-string 1 diff) "A") 'added 'edited)
       'up-to-date)))
 
 (defun vc-git--ls-files-state (state &rest args)