From f0a4c8d764741c8e23bc4cd1ad47151586105f4c Mon Sep 17 00:00:00 2001 From: Dmitry Gutov Date: Sat, 8 Mar 2014 08:56:22 +0200 Subject: [PATCH] Fix #16897 * lisp/vc/vc-git.el (vc-git-command): Turn FILE-OR-LIST into nil when it only contains the repository root. --- lisp/ChangeLog | 5 +++++ lisp/vc/vc-git.el | 10 +++++++++- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index cc5c065c017..7bbc084319b 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,8 @@ +2014-03-08 Dmitry Gutov + + * vc/vc-git.el (vc-git-command): Turn FILE-OR-LIST into nil when + it only contains the repository root. (Bug#16897) + 2014-03-07 Michael Albinus * net/tramp-sh.el (tramp-sh-handle-vc-registered): Run first pass diff --git a/lisp/vc/vc-git.el b/lisp/vc/vc-git.el index 06e46eeb663..c7cae8359bf 100644 --- a/lisp/vc/vc-git.el +++ b/lisp/vc/vc-git.el @@ -1210,7 +1210,15 @@ This command shares argument histories with \\[rgrep] and \\[grep]." The difference to vc-do-command is that this function always invokes `vc-git-program'." (apply 'vc-do-command (or buffer "*vc*") okstatus vc-git-program - file-or-list (cons "--no-pager" flags))) + ;; http://debbugs.gnu.org/16897 + (unless (and (not (cdr-safe file-or-list)) + (let ((file (or (car-safe file-or-list) + file-or-list))) + (and file + (eq ?/ (aref file (1- (length file)))) + (equal file (vc-git-root file))))) + file-or-list) + (cons "--no-pager" flags))) (defun vc-git--empty-db-p () "Check if the git db is empty (no commit done yet)." -- 2.39.2