diff options
author | Miles Bader <miles@gnu.org> | 2008-02-24 10:09:07 +0000 |
---|---|---|
committer | Miles Bader <miles@gnu.org> | 2008-02-24 10:09:07 +0000 |
commit | b03f96dc5a6651d1dc84b81b2a15cad6908b9809 (patch) | |
tree | 699d727fdfb007a12a07d1e1f2e172617cc159ef /lisp/vc-hooks.el | |
parent | 52bec650ae314402c242ce700bb09be42ef8ae55 (diff) | |
parent | 20ca5ee4f7d897d79416a6fdd084db1eabb392b0 (diff) | |
download | emacs-b03f96dc5a6651d1dc84b81b2a15cad6908b9809.tar.gz |
Merge from emacs--rel--22
Revision: emacs@sv.gnu.org/emacs--devo--0--patch-1074
Diffstat (limited to 'lisp/vc-hooks.el')
-rw-r--r-- | lisp/vc-hooks.el | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/lisp/vc-hooks.el b/lisp/vc-hooks.el index 4f26a2e7e79..b177061d50a 100644 --- a/lisp/vc-hooks.el +++ b/lisp/vc-hooks.el @@ -333,12 +333,13 @@ Optional arg INVERT non-nil reverses the sense of the check; the root is the last directory for which WITNESS *is* found." ;; Represent /home/luser/foo as ~/foo so that we don't try to look for ;; witnesses in /home or in /. - (while (not (file-directory-p file)) - (setq file (file-name-directory (directory-file-name file)))) (setq file (abbreviate-file-name file)) (let ((root nil) (prev-file file) - (user (nth 2 (file-attributes file))) + ;; `user' is not initialized outside the loop because + ;; `file' may not exist, so we may have to walk up part of the + ;; hierarchy before we find the "initial UID". + (user nil) try) (while (not (or root (null file) @@ -347,7 +348,9 @@ the root is the last directory for which WITNESS *is* found." ;; to another user. This should save us from looking in ;; things like /net and /afs. This assumes that all the ;; files inside a project belong to the same user. - (not (equal user (nth 2 (file-attributes file)))) + (let ((prev-user user)) + (setq user (nth 2 (file-attributes file))) + (and prev-user (not (equal user prev-user)))) (string-match vc-ignore-dir-regexp file))) (setq try (file-exists-p (expand-file-name witness file))) (cond ((and invert (not try)) (setq root prev-file)) |