[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#50422: 28.0.50; vc-git-checkout: accept nil as first argument
From: |
Tino Calancha |
Subject: |
bug#50422: 28.0.50; vc-git-checkout: accept nil as first argument |
Date: |
Mon, 06 Sep 2021 09:11:15 +0200 |
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
- bug#50422: 28.0.50; vc-git-checkout: accept nil as first argument,
Tino Calancha <=