Subject: bug#79319: [PATCH] * lisp/vc/vc-dispatcher.el (vc-buffer-sync): Check buffer-file-name

From: Sean Whitton <[email-masked]>
Date: Thu, 28 Aug 2025 09:57:28 +0100

Hello,

On Tue 26 Aug 2025 at 07:33pm GMT, Lin Sun wrote:

> Hi,
>
> I got an error when try to revert a buffer:
> vc-revert: Wrong type argument: stringp, nil
>
> Here is the backtrace:
> Debugger entered--Lisp error: (wrong-type-argument stringp nil)
>   vc-buffer-sync(nil)
>   vc-revert()
>   funcall-interactively(vc-revert)
>   command-execute(vc-revert)
>
>
> It caused by reverting a buffer which has no file name (like create a buffer but not saving it).
>
> This patch will check the `` bebuffer-file-name` before call subsequent function.
> Please help review the patch, thanks

I think that vc-revert should probably error out sooner for
non-file-visiting buffers, before it gets to calling vc-buffer-sync.

-- 
Sean Whitton