branch: fix --verbose output column alignment
commit6b364d48f2e72d6c37115e6aa4fe769a523dd1d4
authorTorstein Hegge <hegge@resisty.net>
Thu, 14 Nov 2013 18:18:01 +0000 (14 19:18 +0100)
committerJunio C Hamano <gitster@pobox.com>
Mon, 18 Nov 2013 19:24:08 +0000 (18 11:24 -0800)
treea93d71d4dc4482700970cc9f42fb9f6cad80e170
parentf223459bec106bbe211a01321e48c050a9cad25e
branch: fix --verbose output column alignment

Commit f2e0873 (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: Torstein Hegge <hegge@resisty.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin/branch.c
t/t6040-tracking-info.sh