diff-mode: Support committing diff with file deletions
authorDmitry Gutov <dmitry@gutov.dev>
Wed, 17 Jan 2024 23:25:24 +0000 (01:25 +0200)
committerDmitry Gutov <dmitry@gutov.dev>
Wed, 17 Jan 2024 23:25:24 +0000 (01:25 +0200)
* lisp/vc/diff-mode.el (diff-vc-deduce-fileset):
Remove nil elements from the result (bug#68443).

lisp/vc/diff-mode.el

index 2b9d12a5756f28452c886cbe8b99b850edebb827..4f150dc7f36d604f39bad3404afc69e036675e03 100644 (file)
@@ -2955,7 +2955,7 @@ hunk text is not found in the source file."
       (goto-char (point-min))
       (while (progn (diff-file-next) (not (eobp)))
         (push (diff-find-file-name nil t) files)))
-    (list backend (nreverse files) nil nil 'patch)))
+    (list backend (delete nil (nreverse files)) nil nil 'patch)))
 
 (defun diff--filter-substring (str)
   (when diff-font-lock-prettify