Skip to content
  • Jeff King's avatar
    status: reduce duplicated setup code · 8661768f
    Jeff King authored and Junio C Hamano's avatar Junio C Hamano committed
    
    
    We have three output formats: short, porcelain, and long.
    The short and long formats respect user-config, and the
    porcelain one does not. This led to us repeating
    config-related setup code for the short and long formats.
    
    Since the last commit, color config is explicitly cleared
    when showing the porcelain format. Let's do the same with
    relative-path configuration, which enables us to hoist the
    duplicated code from the switch statement in cmd_status.
    
    As a bonus, this fixes "commit --dry-run --porcelain", which
    was unconditionally setting up that configuration, anyway.
    
    Signed-off-by: default avatarJeff King <peff@peff.net>
    Signed-off-by: default avatarJunio C Hamano <gitster@pobox.com>
    8661768f