From 73a93310a9f38b15a7a849b75b4ea2b3805041ad Mon Sep 17 00:00:00 2001 From: Philip Kaludercic Date: Thu, 7 Mar 2024 10:06:48 +0100 Subject: [PATCH] Ensure default-directory exists when generating diff * lisp/vc/diff.el (diff-no-select): Fall back to the users home directory if default-directory is not a valid path. --- lisp/vc/diff.el | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lisp/vc/diff.el b/lisp/vc/diff.el index a64fbc47853..47566dbc40b 100644 --- a/lisp/vc/diff.el +++ b/lisp/vc/diff.el @@ -188,7 +188,9 @@ diff-no-select (list (or old-alt old) (or new-alt new))))) " ")) - (thisdir default-directory)) + (thisdir (if (file-exists-p default-directory) + default-directory + (expand-file-name "~")))) (with-current-buffer buf (setq buffer-read-only t) (buffer-disable-undo (current-buffer)) -- 2.44.0