summaryrefslogtreecommitdiff
path: root/t/t5510-fetch.sh
diff options
context:
space:
mode:
authorNguyễn Thái Ngọc Duy <pclouds@gmail.com>2016-07-01 16:03:30 (GMT)
committerJunio C Hamano <gitster@pobox.com>2016-07-06 18:48:25 (GMT)
commit6bc91f23a6e14d540ab6950b438d40cf678143f0 (patch)
treebc5df8e366a7eb76ab2683f9b4a3736bdb629f1e /t/t5510-fetch.sh
parent2cb040baa6fcb8a6314a54933cbcb4d3fcb60401 (diff)
downloadgit-6bc91f23a6e14d540ab6950b438d40cf678143f0.zip
git-6bc91f23a6e14d540ab6950b438d40cf678143f0.tar.gz
git-6bc91f23a6e14d540ab6950b438d40cf678143f0.tar.bz2
fetch: align all "remote -> local" output
We do align "remote -> local" output by allocating 10 columns to "remote". That produces aligned output only for short refs. An extra pass is performed to find the longest remote ref name (that does not produce a line longer than terminal width) to produce better aligned output. Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t5510-fetch.sh')
-rwxr-xr-xt/t5510-fetch.sh15
1 files changed, 15 insertions, 0 deletions
diff --git a/t/t5510-fetch.sh b/t/t5510-fetch.sh
index 454d896..f50497e 100755
--- a/t/t5510-fetch.sh
+++ b/t/t5510-fetch.sh
@@ -688,4 +688,19 @@ test_expect_success 'fetching with auto-gc does not lock up' '
)
'
+test_expect_success 'fetch aligned output' '
+ git clone . full-output &&
+ test_commit looooooooooooong-tag &&
+ (
+ cd full-output &&
+ git fetch origin 2>&1 | \
+ grep -e "->" | cut -c 22- >../actual
+ ) &&
+ cat >expect <<-\EOF &&
+ master -> origin/master
+ looooooooooooong-tag -> looooooooooooong-tag
+ EOF
+ test_cmp expect actual
+'
+
test_done