Skip to content
  • Torstein Hegge's avatar
    branch: fix --verbose output column alignment · 6b364d48
    Torstein Hegge authored and Junio C Hamano's avatar Junio C Hamano committed
    Commit f2e08739
    
     (branch: report invalid tracking branch as gone) removed
    an early return from fill_tracking_info() in the path taken when 'git
    branch -v' lists a branch in sync with its upstream. This resulted in an
    unconditionally added space in front of the subject line:
    
        $ git branch -v
        * master f5eb3da  commit pushed to upstream
          topic  f935eb6 unpublished topic
    
    Instead, only add the trailing space if a decoration have been added.
    
    To catch this kind of whitespace breakage in the tests, be a bit less
    smart when filtering the output through sed.
    
    Signed-off-by: default avatarTorstein Hegge <hegge@resisty.net>
    Signed-off-by: default avatarJunio C Hamano <gitster@pobox.com>
    6b364d48