aboutsummaryrefslogtreecommitdiff
path: root/lisp
diff options
context:
space:
mode:
authorJonas Bernoulli <jonas@bernoul.li>2025-09-22 16:53:21 +0200
committerJonas Bernoulli <jonas@bernoul.li>2025-09-22 16:53:21 +0200
commit31c0ae17d34aab0bb7dd83f10d15de617a37f39e (patch)
treeeaaf4bb570516b8e6d46a1005e585e6a0202f645 /lisp
parent2d1c55295bb0f94ce68ff42eef78def9be96d484 (diff)
magit-delete-shelved-branch: New command
Diffstat (limited to 'lisp')
-rw-r--r--lisp/magit-log.el7
-rw-r--r--lisp/magit-refs.el4
2 files changed, 11 insertions, 0 deletions
diff --git a/lisp/magit-log.el b/lisp/magit-log.el
index 9243feb..bc1226b 100644
--- a/lisp/magit-log.el
+++ b/lisp/magit-log.el
@@ -885,6 +885,13 @@ https://github.com/mhagger/git-when-merged."
(user-error "Could not find when %s was merged into %s: %s"
commit branch m)))))
+;;;###autoload
+(defun magit-delete-shelved-branch (branch)
+ "Delete the shelved BRANCH.
+Delete a ref created by `magit-branch-shelve'."
+ (interactive (list (magit-read-shelved-branch "Log shelved branch")))
+ (magit-run-git "update-ref" "-d" (concat "refs/shelved/" branch)))
+
;;;; Limit Commands
(defun magit-log-toggle-commit-limit ()
diff --git a/lisp/magit-refs.el b/lisp/magit-refs.el
index bdb40ec..8a53dba 100644
--- a/lisp/magit-refs.el
+++ b/lisp/magit-refs.el
@@ -496,6 +496,10 @@ Branch %s already exists.
"<2>" (magit-menu-item "Delete %m" #'magit-branch-delete)
"<1>" (magit-menu-item "Visit commit" #'magit-visit-ref))
+(defvar-keymap magit-shelved-branch-section-map
+ :doc "Keymap for `shelved-branch' sections."
+ "<remap> <magit-delete-thing>" #'magit-delete-shelved-branch)
+
(defvar-keymap magit-tag-section-map
:doc "Keymap for `tag' sections."
"<remap> <magit-delete-thing>" #'magit-tag-delete