summaryrefslogtreecommitdiff
path: root/lisp/vc-git.el
diff options
context:
space:
mode:
authorDan Nicolaescu <dann@ics.uci.edu>2008-03-29 05:34:52 +0000
committerDan Nicolaescu <dann@ics.uci.edu>2008-03-29 05:34:52 +0000
commit115c0061772238c4118c271903336405d35416e7 (patch)
tree3a2eb12205c25c977e35dda23e7e7d8436bc2050 /lisp/vc-git.el
parentf3d57a2c20d2916f8515a6e334cdc3dca4e12b4e (diff)
downloademacs-115c0061772238c4118c271903336405d35416e7.tar.gz
* vc.el (vc-status-menu-map, vc-status-mode-map): Bind vc-revert.
(vc-status-refresh): Create a temporary buffer and call the `dir-status' backend function from that buffer. * vc-bzr.el (vc-bzr-dir-status): Don't create a buffer. (vc-bzr-after-dir-status): Don't kill the buffer. * vc-cvs.el (vc-cvs-dir-status): Don't create a buffer. (vc-cvs-after-dir-status): Don't kill the buffer. * vc-git.el (vc-git-dir-status): Don't create a buffer. (vc-git-after-dir-status-stage2): Don't kill the buffer. * vc-hg.el (vc-hg-dir-status): Don't create a buffer. (vc-hg-after-dir-status): Don't kill the buffer. * vc-svn.el (vc-svn-dir-status): Don't create a buffer. (vc-svn-after-dir-status): Don't kill the buffer.
Diffstat (limited to 'lisp/vc-git.el')
-rw-r--r--lisp/vc-git.el29
1 files changed, 11 insertions, 18 deletions
diff --git a/lisp/vc-git.el b/lisp/vc-git.el
index e4150f558ae..795f57c245d 100644
--- a/lisp/vc-git.el
+++ b/lisp/vc-git.el
@@ -215,9 +215,7 @@
(goto-char (point-min))
(while (re-search-forward "\\([^\0]*?\\)\0" nil t 1)
(push (cons (match-string 1) 'unregistered) vc-git-status-result))
- (funcall update-function (nreverse vc-git-status-result) status-buffer)
- ;; Remove the temporary buffer.
- (kill-buffer (current-buffer)))
+ (funcall update-function (nreverse vc-git-status-result) status-buffer))
(defun vc-git-after-dir-status-stage1 (update-function status-buffer)
(goto-char (point-min))
@@ -248,21 +246,16 @@
;; Further things that would have to be fixed later:
;; - how to handle unregistered directories
;; - how to support vc-status on a subdir of the project tree
- (with-current-buffer
- (get-buffer-create
- (expand-file-name " *VC-Git* tmp status" dir))
- (set (make-local-variable 'vc-git-status-result) nil)
- (cd dir)
- (erase-buffer)
- (if (vc-git--empty-db-p)
- (progn
- (vc-git-command (current-buffer) 'async nil "ls-files" "-z" "-c")
- (vc-exec-after
- `(vc-git-after-dir-status-stage1-empty-db (quote ,update-function) ,status-buffer)))
- (vc-git-command (current-buffer) 'async nil "diff-index" "-z" "HEAD")
- (vc-exec-after
- `(vc-git-after-dir-status-stage1 (quote ,update-function) ,status-buffer)))
- (current-buffer)))
+ (set (make-local-variable 'vc-git-status-result) nil)
+ (if (vc-git--empty-db-p)
+ (progn
+ (vc-git-command (current-buffer) 'async nil "ls-files" "-z" "-c")
+ (vc-exec-after
+ `(vc-git-after-dir-status-stage1-empty-db
+ (quote ,update-function) ,status-buffer)))
+ (vc-git-command (current-buffer) 'async nil "diff-index" "-z" "HEAD")
+ (vc-exec-after
+ `(vc-git-after-dir-status-stage1 (quote ,update-function) ,status-buffer))))
(defun vc-git-status-extra-headers (dir)
(let ((str (with-output-to-string