summaryrefslogtreecommitdiff
path: root/lisp
diff options
context:
space:
mode:
authorKyle Meyer <kyle@kyleam.com>2019-10-10 18:27:34 -0400
committerKyle Meyer <kyle@kyleam.com>2019-10-10 18:28:28 -0400
commita7462432dcb7b6f7a19ce0609b5ed2f942126c8c (patch)
tree644eb32742c90d9ae113f7917f45a20e52339eb1 /lisp
parent4da0bef75120ddbee64f6d80b4ead18d3dde2b3f (diff)
downloademacs.d-a7462432dcb7b6f7a19ce0609b5ed2f942126c8c.tar.gz
magit: Add command for configuring refs/pull/*/head fetch
Diffstat (limited to 'lisp')
-rw-r--r--lisp/km-magit.el11
1 files changed, 11 insertions, 0 deletions
diff --git a/lisp/km-magit.el b/lisp/km-magit.el
index a04a15a..062944d 100644
--- a/lisp/km-magit.el
+++ b/lisp/km-magit.el
@@ -726,6 +726,17 @@ category."
(magit-define-section-jumper magit-jump-to-remote-counts
"Remote counts" remote-counts)
+(defun km/magit-add-pull-refspec-to-origin ()
+ "Configure repository to pull refs/pull/*/head from 'origin'."
+ (interactive)
+ (let* ((keys (list "remote" "origin" "fetch"))
+ (existing (apply #'magit-get-all keys))
+ (rs "+refs/pull/*/head:refs/pull/origin/*"))
+ (unless (member rs existing)
+ (apply #'magit-set-all
+ (append existing (list rs))
+ keys))))
+
;;; Copy functions