aboutsummaryrefslogtreecommitdiff
path: root/lisp/magit-refs.el
diff options
context:
space:
mode:
authorJonas Bernoulli <jonas@bernoul.li>2025-04-16 07:53:52 +0200
committerJonas Bernoulli <jonas@bernoul.li>2025-04-16 07:53:52 +0200
commitd6b77845470f67b23a8b2776bad5c0ece0a30000 (patch)
tree9f013a6abfa04ac8f58f2df3f7e6082484bb4db5 /lisp/magit-refs.el
parent78ffd1a38917d67f091dd5c26a67b6ef3e350634 (diff)
magit-insert-shelved-branches: New function
Diffstat (limited to 'lisp/magit-refs.el')
-rw-r--r--lisp/magit-refs.el15
1 files changed, 15 insertions, 0 deletions
diff --git a/lisp/magit-refs.el b/lisp/magit-refs.el
index be8a961..af50205 100644
--- a/lisp/magit-refs.el
+++ b/lisp/magit-refs.el
@@ -639,6 +639,21 @@ line is inserted at all."
(insert ?\n)
(magit-make-margin-overlay nil t)))
+(defun magit-insert-shelved-branches ()
+ "Insert sections showing all shelved branches."
+ (when-let ((refs (magit-list-refs "refs/shelved/")))
+ (magit-insert-section (shelved-branches nil)
+ (magit-insert-heading t "Shelved branches")
+ (dolist (ref refs)
+ (magit-insert-section (shelved-branch ref t)
+ (magit-insert-heading
+ (magit--propertize-face (substring ref 13) 'magit-refname))
+ (when (magit-buffer-margin-p)
+ (magit-refs--format-margin ref))
+ (magit-refs--insert-cherry-commits ref)))
+ (insert ?\n)
+ (magit-make-margin-overlay nil t))))
+
(defun magit-refs--format-local-branches ()
(let ((lines (seq-keep #'magit-refs--format-local-branch
(magit-git-lines