aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDan Nicolaescu2007-07-23 15:02:16 +0000
committerDan Nicolaescu2007-07-23 15:02:16 +0000
commit4d3ac01e411ed927223d2774fb3e75bf0b2f71bd (patch)
treee9a08a9ee7b0a035fe7b9890440cfb6ab10eafbd
parent56b328008655ef2014a7eb36294ee5c21c3aaf52 (diff)
downloademacs-4d3ac01e411ed927223d2774fb3e75bf0b2f71bd.tar.gz
emacs-4d3ac01e411ed927223d2774fb3e75bf0b2f71bd.zip
(vc-git-workfile-unchanged-p): Update comment.
-rw-r--r--lisp/ChangeLog4
-rw-r--r--lisp/vc-git.el14
2 files changed, 17 insertions, 1 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 66ec40aadc7..c46ad1166bc 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,7 @@
12007-07-23 Alexandre Julliard <julliard@winehq.org>
2
3 * vc-git.el (vc-git-workfile-unchanged-p): Update comment.
4
12007-07-20 Kenichi Handa <handa@m17n.org> 52007-07-20 Kenichi Handa <handa@m17n.org>
2 6
3 * international/utf-8.el (utf-8-post-read-conversion): Temporarily 7 * international/utf-8.el (utf-8-post-read-conversion): Temporarily
diff --git a/lisp/vc-git.el b/lisp/vc-git.el
index df09fc5b885..8b46c957cdf 100644
--- a/lisp/vc-git.el
+++ b/lisp/vc-git.el
@@ -191,8 +191,20 @@
191(defun vc-git-checkout-model (file) 191(defun vc-git-checkout-model (file)
192 'implicit) 192 'implicit)
193 193
194;; XXX Can't this just use the result of vc-git-state?
195(defun vc-git-workfile-unchanged-p (file) 194(defun vc-git-workfile-unchanged-p (file)
195 ;; The reason this does not use the result of vc-git-state is that
196 ;; git-diff-index (used by vc-git-state) doesn't refresh the cached
197 ;; stat info, so if the file has been modified it will always show
198 ;; up as modified in vc-git-state, even if the change has been
199 ;; undone, until git-update-index --refresh is run.
200
201 ;; OTOH the vc-git-workfile-unchanged-p implementation checks the
202 ;; actual content, so it will detect the case of a file reverted
203 ;; back to its original state.
204
205 ;; The ideal implementation would be to refresh the stat cache and
206 ;; then call vc-git-state, but at the moment there's no git command
207 ;; to refresh a single file, so this will have to be added first.
196 (let ((sha1 (vc-git--run-command-string file "hash-object" "--")) 208 (let ((sha1 (vc-git--run-command-string file "hash-object" "--"))
197 (head (vc-git--run-command-string file "ls-tree" "-z" "HEAD" "--"))) 209 (head (vc-git--run-command-string file "ls-tree" "-z" "HEAD" "--")))
198 (and head 210 (and head