1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2025-12-15 10:30:25 -08:00

(vc-ensure-vc-buffer): Avoid infinite looping when

vc-parent-buffer is the current buffer.
This commit is contained in:
Martin Rudalics 2007-12-19 09:25:18 +00:00
parent d6a4ad7475
commit 772111be13

View file

@ -1297,7 +1297,10 @@ Otherwise, throw an error."
"Make sure that the current buffer visits a version-controlled file."
(if vc-dired-mode
(set-buffer (find-file-noselect (dired-get-filename)))
(while vc-parent-buffer
(while (and vc-parent-buffer
;; Avoid infinite looping when vc-parent-buffer and
;; current buffer are the same buffer.
(not (eq vc-parent-buffer (current-buffer))))
(set-buffer vc-parent-buffer))
(if (not buffer-file-name)
(error "Buffer %s is not associated with a file" (buffer-name))