Mercurial > emacs
comparison lisp/vc-git.el @ 94521:2a61c5f918a5
Change 'needs-patch to 'needs-update.
author | Eric S. Raymond <esr@snark.thyrsus.com> |
---|---|
date | Thu, 01 May 2008 19:13:16 +0000 |
parents | ad6c174910db |
children | fee32a11924d |
comparison
equal
deleted
inserted
replaced
94520:069edac43148 | 94521:2a61c5f918a5 |
---|---|
154 (?T 'edited))) ;; FIXME | 154 (?T 'edited))) ;; FIXME |
155 | 155 |
156 (defun vc-git-state (file) | 156 (defun vc-git-state (file) |
157 "Git-specific version of `vc-state'." | 157 "Git-specific version of `vc-state'." |
158 ;; FIXME: This can't set 'ignored yet | 158 ;; FIXME: This can't set 'ignored yet |
159 (vc-git--call nil "add" "--refresh" "--" (file-relative-name file)) | 159 (if (not (vc-git-registered file)) |
160 (let ((diff (vc-git--run-command-string file "diff-index" "-z" "HEAD" "--"))) | 160 'unregistered |
161 (if (and diff (string-match ":[0-7]\\{6\\} [0-7]\\{6\\} [0-9a-f]\\{40\\} [0-9a-f]\\{40\\} \\([ADMUT]\\)\0[^\0]+\0" | 161 (vc-git--call nil "add" "--refresh" "--" (file-relative-name file)) |
162 diff)) | 162 (let ((diff (vc-git--run-command-string file "diff-index" "-z" "HEAD" "--"))) |
163 (vc-git--state-code (match-string 1 diff)) | 163 (if (and diff (string-match ":[0-7]\\{6\\} [0-7]\\{6\\} [0-9a-f]\\{40\\} [0-9a-f]\\{40\\} \\([ADMUT]\\)\0[^\0]+\0" |
164 (if (vc-git--empty-db-p) 'added 'up-to-date)))) | 164 diff)) |
165 (vc-git--state-code (match-string 1 diff)) | |
166 (if (vc-git--empty-db-p) 'added 'up-to-date))))) | |
165 | 167 |
166 (defun vc-git--ls-files-state (state &rest args) | 168 (defun vc-git--ls-files-state (state &rest args) |
167 "Set state to STATE on all files found with git-ls-files ARGS." | 169 "Set state to STATE on all files found with git-ls-files ARGS." |
168 (with-temp-buffer | 170 (with-temp-buffer |
169 (apply 'vc-git-command (current-buffer) nil nil "ls-files" "-z" args) | 171 (apply 'vc-git-command (current-buffer) nil nil "ls-files" "-z" args) |