• Jeff King's avatar
    status: refactor colopts handling · 4d2292e9
    Jeff King authored
    The current code reads the config and command-line options
    into a separate "colopts" variable, and then copies the
    contents of that variable into the "struct wt_status". We
    can eliminate the extra variable and copy just write
    straight into the wt_status struct.
    
    This simplifies the "status" code a little bit.
    Unfortunately, it makes the "commit" code one line more
    complex; a side effect of the separate variable was that
    "commit" did not copy the colopts variable, so any
    column.status configuration had no effect.
    
    The result still ends up cleaner, though. In the previous
    version, it was unclear whether commit simply forgot to copy
    the colopt variable, or whether it was intentional. Now it
    explicitly turns off column options. Furthermore, if commit
    later learns to respect column.status, this will make the
    end result simpler. I punted on just adding that feature
    now, because it was sufficiently non-obvious that it should
    not go into a refactoring patch.
    Signed-off-by: default avatarJeff King <[email protected]>
    4d2292e9
wt-status.h 2.05 KB