Skip to content

Commit 39b2c6f

Browse files
committed
Merge branch 'jc/advice-sans-trailing-whitespace'
The "hint:" messages given by the advice mechanism, when given a message with a blank line, left a line with trailing whitespace, which has been cleansed. * jc/advice-sans-trailing-whitespace: advice: omit trailing whitespace
2 parents 8289a36 + 2d8cf94 commit 39b2c6f

File tree

3 files changed

+6
-5
lines changed

3 files changed

+6
-5
lines changed

advice.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,8 +105,9 @@ static void vadvise(const char *advice, int display_instructions,
105105

106106
for (cp = buf.buf; *cp; cp = np) {
107107
np = strchrnul(cp, '\n');
108-
fprintf(stderr, _("%shint: %.*s%s\n"),
108+
fprintf(stderr, _("%shint:%s%.*s%s\n"),
109109
advise_get_color(ADVICE_COLOR_HINT),
110+
(np == cp) ? "" : " ",
110111
(int)(np - cp), cp,
111112
advise_get_color(ADVICE_COLOR_RESET));
112113
if (*np)

t/t3200-branch.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1154,9 +1154,9 @@ test_expect_success 'avoid ambiguous track and advise' '
11541154
hint: tracking ref '\''refs/heads/main'\'':
11551155
hint: ambi1
11561156
hint: ambi2
1157-
hint: ''
1157+
hint:
11581158
hint: This is typically a configuration error.
1159-
hint: ''
1159+
hint:
11601160
hint: To support setting up tracking branches, ensure that
11611161
hint: different remotes'\'' fetch refspecs map into different
11621162
hint: tracking namespaces.

t/t7004-tag.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1777,10 +1777,10 @@ test_expect_success '--points-at finds annotated tags of tags' '
17771777
'
17781778

17791779
test_expect_success 'recursive tagging should give advice' '
1780-
sed -e "s/|$//" <<-EOF >expect &&
1780+
cat >expect <<-EOF &&
17811781
hint: You have created a nested tag. The object referred to by your new tag is
17821782
hint: already a tag. If you meant to tag the object that it points to, use:
1783-
hint: |
1783+
hint:
17841784
hint: git tag -f nested annotated-v4.0^{}
17851785
hint: Disable this message with "git config advice.nestedTag false"
17861786
EOF

0 commit comments

Comments
 (0)