branch: elpa/magit commit ed4fa09eeeb531c0cfc3c7bf713d3929c2b2107d Author: Jonas Bernoulli <jo...@bernoul.li> Commit: Jonas Bernoulli <jo...@bernoul.li>
magit-insert-head-branch-header: Reduce scope of a let-binding Closes #5333. --- lisp/magit-status.el | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/lisp/magit-status.el b/lisp/magit-status.el index 2b90b21d89..984e907d6e 100644 --- a/lisp/magit-status.el +++ b/lisp/magit-status.el @@ -568,13 +568,12 @@ the status buffer causes this section to disappear again." "Insert a header line about the current branch. If `HEAD' is detached, then insert information about that commit instead. The optional BRANCH argument is for internal use only." - (let ((branch (or branch (magit-get-current-branch))) - (output (magit-rev-format "%h %s" (or branch "HEAD")))) + (let ((output (magit-rev-format "%h %s" (or branch "HEAD")))) (string-match "^\\([^ ]+\\) \\(.*\\)" output) (magit-bind-match-strings (commit summary) output (when (equal summary "") (setq summary "(no commit message)")) - (if branch + (if-let ((branch (or branch (magit-get-current-branch)))) (magit-insert-section (branch branch) (insert (format "%-10s" "Head: ")) (when magit-status-show-hashes-in-headers