From a7462432dcb7b6f7a19ce0609b5ed2f942126c8c Mon Sep 17 00:00:00 2001 From: Kyle Meyer Date: Thu, 10 Oct 2019 18:27:34 -0400 Subject: magit: Add command for configuring refs/pull/*/head fetch --- lisp/km-magit.el | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'lisp') 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 -- cgit v1.2.3