• Jonas Bernoulli's avatar
    Stop using cl-defun to define certain magit-get-{*} functions · 875f913b
    Jonas Bernoulli authored
    The functions `magit-get-upstream-branch' and `magit-get-push-branch'
    recently gained a second optional argument VERIFY.  That is a problem
    because the default value of the existing first argument, BRANCH, was
    defined using `cl-defun's (VAR INITFORM) format.  The value of the
    INITFORM, which is (magit-get-current-branch), is only used when the
    VAR isn't provided by the caller at all.  If the VAR is provided, but
    `nil', then that provided value `nil' is used.
    
    Previously it wouldn't have made much sense to use (FN nil), but now
    it is reasonable to use (FN nil t) and expect the default to be used.
    But actually one had to write (FN (magit-get-current-branch) t) until
    before this commit.
    
    But that clearly is very cumbersome, and so we stop using `cl-defun'
    and instead, if necessary, determine the default value inside the body
    of the affected functions.
    
    For consistency, we do the same thing for `magit-get-upstream-ref',
    `magit-get-upstream-remote', and `magit-get-push-remote', even though
    these functions (currently) do not take a second optional argument.
    
    Fixes #2960.
    875f913b
Name
Last commit
Last update
Documentation Loading commit data...
lisp Loading commit data...
t Loading commit data...
.dir-locals.el Loading commit data...
.gitignore Loading commit data...
.mailmap Loading commit data...
.travis.yml Loading commit data...
CONTRIBUTING.md Loading commit data...
COPYING Loading commit data...
ISSUE_TEMPLATE Loading commit data...
Makefile Loading commit data...
README.md Loading commit data...
default.mk Loading commit data...