From: Kévin Le Gouguec Date: Wed, 21 Aug 2024 06:45:00 +0000 (+0200) Subject: Restore vc-git helper function (bug#68183) X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=f8be957322c6349e7f6130a9737acc5461d8c362;p=emacs.git Restore vc-git helper function (bug#68183) * lisp/vc/vc-git.el (vc-git--cmds-in-progress): Restore; it was removed in a previous refactoring patch, but we may still find use for it. (vc-git-dir--in-progress-headers): Use it. (cherry picked from commit 53ea5f1df411aa349fb99d6b444d433a42ded594) --- diff --git a/lisp/vc/vc-git.el b/lisp/vc/vc-git.el index 4d631c7e032..dedf6fdd219 100644 --- a/lisp/vc/vc-git.el +++ b/lisp/vc/vc-git.el @@ -748,8 +748,8 @@ or an empty string if none." (and tracking (fmt "Tracking" tracking)) (and remote-url (fmt "Remote" remote-url))))))) -(defun vc-git-dir--in-progress-headers () - "Return headers for Git commands in progress in this worktree." +(defun vc-git--cmds-in-progress () + "Return a list of Git commands in progress in this worktree." (let ((gitdir (vc-git--git-path)) cmds) ;; See contrib/completion/git-prompt.sh in git.git. @@ -765,6 +765,11 @@ or an empty string if none." (push 'merge cmds)) (when (file-exists-p (expand-file-name "BISECT_START" gitdir)) (push 'bisect cmds)) + cmds)) + +(defun vc-git-dir--in-progress-headers () + "Return headers for Git commands in progress in this worktree." + (let ((cmds (vc-git--cmds-in-progress))) (cl-flet ((fmt (cmd name) (when (memq cmd cmds) ;; For now just a heading, key bindings can be added