Merge branch 'nd/term-columns'
authorJunio C Hamano <gitster@pobox.com>
Wed, 23 May 2018 05:38:13 +0000 (14:38 +0900)
committerJunio C Hamano <gitster@pobox.com>
Wed, 23 May 2018 05:38:13 +0000 (14:38 +0900)
The code did not propagate the terminal width to subprocesses via
COLUMNS environment variable, which it now does. This caused
trouble to "git column" helper subprocess when "git tag --column=row"
tried to list the existing tags on a display with non-default width.

* nd/term-columns:
column: fix off-by-one default width
pager: set COLUMNS to term_columns()

1  2 
t/t7004-tag.sh
diff --combined t/t7004-tag.sh
index e3f1e014aaa07444445cbb1d50d8fdc76e1b4aa5,afb8c75594961b06f603c45b0f953cf94725cc47..d7b319e919c83ca677737840f70075c173364209
@@@ -363,7 -363,7 +363,7 @@@ test_expect_success 'tag -l <pattern> -
  '
  
  test_expect_success 'listing tags in column' '
-       COLUMNS=40 git tag -l --column=row >actual &&
+       COLUMNS=41 git tag -l --column=row >actual &&
        cat >expected <<\EOF &&
  a1      aa1     cba     t210    t211
  v0.2.1  v1.0    v1.0.1  v1.1.3
@@@ -1056,18 -1056,7 +1056,18 @@@ test_expect_success GPG 
        git tag -s -F sigblanknonlfile blanknonlfile-signed-tag &&
        get_tag_msg blanknonlfile-signed-tag >actual &&
        test_cmp expect actual &&
 -      git tag -v signed-tag
 +      git tag -v blanknonlfile-signed-tag
 +'
 +
 +test_expect_success GPG 'signed tag with embedded PGP message' '
 +      cat >msg <<-\EOF &&
 +      -----BEGIN PGP MESSAGE-----
 +
 +      this is not a real PGP message
 +      -----END PGP MESSAGE-----
 +      EOF
 +      git tag -s -F msg confusing-pgp-message &&
 +      git tag -v confusing-pgp-message
  '
  
  # messages with commented lines for signed tags: