unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#50422: 28.0.50; vc-git-checkout: accept nil as first argument
@ 2021-09-06  7:11 Tino Calancha
  2021-09-07 23:34 ` bug#39452: " Dmitry Gutov
  0 siblings, 1 reply; 2+ messages in thread
From: Tino Calancha @ 2021-09-06  7:11 UTC (permalink / raw)
  To: 50422; +Cc: 39452

X-Debbugs-Cc: 39452@debbugs.gnu.org

Before the fix from bug#39452, the following was a valid call:

(vc-git-checkout nil "master")

Note that `vc-git-command' handles a nil 3rd argument.
(I rely in such a behavior).

Since we call now `vc-git--literal-pathspec' in several commands, then
we could add a check at the beginning of this function:

--8<-----------------------------cut here---------------start------------->8---
diff --git a/lisp/vc/vc-git.el b/lisp/vc/vc-git.el
index 037fbcbc48..18ec4b6075 100644
--- a/lisp/vc/vc-git.el
+++ b/lisp/vc/vc-git.el
@@ -245,11 +245,12 @@ vc-git-update-on-retrieve-tag
 (defun vc-git--literal-pathspec (file)
   "Prepend :(literal) path magic to FILE."
   ;; Good example of file name that needs this: "test[56].xx".
-  (let ((lname (file-local-name file)))
-    ;; Expand abbreviated file names.
-    (when (file-name-absolute-p lname)
-      (setq lname (expand-file-name lname)))
-    (and file (concat ":(literal)" lname))))
+  (when (stringp file)
+    (let ((lname (file-local-name file)))
+      ;; Expand abbreviated file names.
+      (when (file-name-absolute-p lname)
+        (setq lname (expand-file-name lname)))
+      (and file (concat ":(literal)" lname)))))
 
 (defun vc-git--literal-pathspecs (files)
   "Prepend :(literal) path magic to FILES."
--8<-----------------------------cut here---------------end--------------->8---


In GNU Emacs 28.0.50 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.30, cairo version 1.16.0)
 of 2021-09-05 built on localhost.example.com
Repository revision: c61e2bff44bc494be15ba0a9f0f964389fd45b25
Repository branch: 46374-fix-regression
Windowing system distributor 'The X.Org Foundation', version 11.0.12013000
System Description: openSUSE Tumbleweed






^ permalink raw reply related	[flat|nested] 2+ messages in thread

* bug#39452: bug#50422: 28.0.50; vc-git-checkout: accept nil as first argument
  2021-09-06  7:11 bug#50422: 28.0.50; vc-git-checkout: accept nil as first argument Tino Calancha
@ 2021-09-07 23:34 ` Dmitry Gutov
  0 siblings, 0 replies; 2+ messages in thread
From: Dmitry Gutov @ 2021-09-07 23:34 UTC (permalink / raw)
  To: Tino Calancha, 50422-done; +Cc: 39452

Hi Tino,

On 06.09.2021 10:11, Tino Calancha wrote:
> X-Debbugs-Cc:39452@debbugs.gnu.org
> 
> Before the fix from bug#39452, the following was a valid call:
> 
> (vc-git-checkout nil "master")
> 
> Note that `vc-git-command' handles a nil 3rd argument.
> (I rely in such a behavior).
> 
> Since we call now `vc-git--literal-pathspec' in several commands, then
> we could add a check at the beginning of this function:

Yes, I broke this with the most recent fix in that area. Sorry.

Should be fixed now with commit ff2c4a8353.





^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-09-07 23:34 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-09-06  7:11 bug#50422: 28.0.50; vc-git-checkout: accept nil as first argument Tino Calancha
2021-09-07 23:34 ` bug#39452: " Dmitry Gutov

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).