X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=contrib%2Femacs%2Fvc-git.el;h=3eb4bd19e921f293f1ed1ab1fd1bcd9f78763c4c;hb=4de0f9f9b6ed1731de00b67952504e5a783f54a4;hp=8b6361922fd6e6a2fcd9acb20fd54f5b645b36f0;hpb=368c2ac249ac2261784e1b9b9bc7c98c5e859052;p=git.git diff --git a/contrib/emacs/vc-git.el b/contrib/emacs/vc-git.el index 8b6361922..3eb4bd19e 100644 --- a/contrib/emacs/vc-git.el +++ b/contrib/emacs/vc-git.el @@ -58,8 +58,9 @@ (with-temp-buffer (let* ((dir (file-name-directory file)) (name (file-relative-name file dir))) - (when dir (cd dir)) - (and (ignore-errors (eq 0 (call-process "git" nil '(t nil) nil "ls-files" "-c" "-z" "--" name))) + (and (ignore-errors + (when dir (cd dir)) + (eq 0 (call-process "git" nil '(t nil) nil "ls-files" "-c" "-z" "--" name))) (let ((str (buffer-string))) (and (> (length str) (length name)) (string= (substring str 0 (1+ (length name))) (concat name "\0"))))))))