diff options
| author | Jonas Bernoulli <jonas@bernoul.li> | 2022-06-25 13:31:49 +0200 |
|---|---|---|
| committer | Jonas Bernoulli <jonas@bernoul.li> | 2022-06-25 13:31:49 +0200 |
| commit | 12b415e0333bd4f6523236cbc9791173dcda160f (patch) | |
| tree | d10d3e483d4617375238cd65fc797e00187feb7c /lisp/magit-push.el | |
| parent | bf0ef3826bcda9d90f3e3c9a8f801c2c3c01bc5b (diff) | |
magit-push-implicitly--desc: Return desc for push.default=nothing
Diffstat (limited to 'lisp/magit-push.el')
| -rw-r--r-- | lisp/magit-push.el | 51 |
1 files changed, 27 insertions, 24 deletions
diff --git a/lisp/magit-push.el b/lisp/magit-push.el index c28aca5..7c68ce1 100644 --- a/lisp/magit-push.el +++ b/lisp/magit-push.el @@ -292,30 +292,33 @@ what this command will do. For example: (defun magit-push-implicitly--desc () (let ((default (magit-get "push.default"))) - (unless (equal default "nothing") - (or (and-let* ((remote (or (magit-get-remote) - (magit-primary-remote))) - (refspec (magit-get "remote" remote "push"))) - (format "%s using %s" - (magit--propertize-face remote 'magit-branch-remote) - (magit--propertize-face refspec 'bold))) - (and-let* ((upstream (and (not (magit-get-push-branch)) - (magit-get-upstream-branch)))) - (format "%s aka %s\n" - (magit-branch-set-face upstream) - (magit--propertize-face "@{upstream}" 'bold))) - (and-let* ((push-branch (magit-get-push-branch))) - (format "%s aka %s\n" - (magit-branch-set-face push-branch) - (magit--propertize-face "pushRemote" 'bold))) - (and-let* ((push-branch (magit-get-@{push}-branch))) - (format "%s aka %s\n" - (magit-branch-set-face push-branch) - (magit--propertize-face "@{push}" 'bold))) - (format "using %s (%s is %s)\n" - (magit--propertize-face "git push" 'bold) - (magit--propertize-face "push.default" 'bold) - (magit--propertize-face default 'bold)))))) + (or (and (equal default "nothing") + (format "nothing (%s is %s)\n" + (magit--propertize-face "push.default" 'bold) + (magit--propertize-face default 'bold))) + (and-let* ((remote (or (magit-get-remote) + (magit-primary-remote))) + (refspec (magit-get "remote" remote "push"))) + (format "%s using %s" + (magit--propertize-face remote 'magit-branch-remote) + (magit--propertize-face refspec 'bold))) + (and-let* ((upstream (and (not (magit-get-push-branch)) + (magit-get-upstream-branch)))) + (format "%s aka %s\n" + (magit-branch-set-face upstream) + (magit--propertize-face "@{upstream}" 'bold))) + (and-let* ((push-branch (magit-get-push-branch))) + (format "%s aka %s\n" + (magit-branch-set-face push-branch) + (magit--propertize-face "pushRemote" 'bold))) + (and-let* ((push-branch (magit-get-@{push}-branch))) + (format "%s aka %s\n" + (magit-branch-set-face push-branch) + (magit--propertize-face "@{push}" 'bold))) + (format "using %s (%s is %s)\n" + (magit--propertize-face "git push" 'bold) + (magit--propertize-face "push.default" 'bold) + (magit--propertize-face default 'bold))))) ;;;###autoload (defun magit-push-to-remote (remote args) |
