* lisp/vc/vc-git.el (vc-git-symbolic-commit): Use --no-undefined
authorPhilip Kaludercic <philipk@posteo.net>
Fri, 14 Oct 2022 22:06:25 +0000 (00:06 +0200)
committerPhilip Kaludercic <philipk@posteo.net>
Sat, 15 Oct 2022 15:22:49 +0000 (17:22 +0200)
lisp/vc/vc-git.el

index 0eae7dd6b8586bf2c9147d2b70d8a5b437b9e522..3c6afec0378cad42f6135b5cf01e10fc4b0dc42b 100644 (file)
@@ -2038,16 +2038,15 @@ allowed to include revision specifications like \"master~8\"
 branch), otherwise such revision specifications are rejected, and
 the function returns nil."
   (and commit
-       (let ((name (with-temp-buffer
-                     (and
-                      (vc-git--out-ok "name-rev" "--name-only" commit)
-                      (goto-char (point-min))
-                      (or force (not (looking-at "^.*[~^].*$" t)))
-                      (= (forward-line 2) 1)
-                      (bolp)
-                      (buffer-substring-no-properties (point-min)
-                                                      (1- (point-max)))))))
-         (and name (not (string= name "undefined")) name))))
+       (with-temp-buffer
+         (and
+          (vc-git--out-ok "name-rev" "--no-undefined" "--name-only" commit)
+          (goto-char (point-min))
+          (or force (not (looking-at "^.*[~^].*$" t)))
+          (= (forward-line 2) 1)
+          (bolp)
+          (buffer-substring-no-properties (point-min)
+                                          (1- (point-max)))))))
 
 (defvar-keymap vc-dir-git-mode-map
   "z c" #'vc-git-stash