Skip to content

Commit 2f0f7f1

Browse files
moygitster
authored andcommitted
status: add missing blank line after list of "other" files
List of files in other sections ("Changes to be committed", ...) end with a blank line. It is not the case with the "Untracked files" and "Ignored files" sections. The issue become particularly visible after the #-prefix removal, as the last line (e.g. "nothing added to commit but untracked files present") seems mixed with the untracked files. Signed-off-by: Matthieu Moy <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 1c7969c commit 2f0f7f1

File tree

2 files changed

+24
-1
lines changed

2 files changed

+24
-1
lines changed

t/t7508-status.sh

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,7 @@ test_expect_success 'status --column' '
8484
#
8585
# dir1/untracked dir2/untracked output
8686
# dir2/modified expect untracked
87+
#
8788
EOF
8889
COLUMNS=50 git -c status.displayCommentPrefix=true status --column="column dense" >output &&
8990
test_i18ncmp expect output
@@ -117,6 +118,7 @@ cat >expect <<\EOF
117118
# expect
118119
# output
119120
# untracked
121+
#
120122
EOF
121123

122124
test_expect_success 'status with status.displayCommentPrefix=true' '
@@ -167,6 +169,7 @@ Untracked files:
167169
expect
168170
output
169171
untracked
172+
170173
EOF
171174

172175
test_expect_success 'status (advice.statusHints false)' '
@@ -241,6 +244,7 @@ Untracked files:
241244
(use "git add <file>..." to include in what will be committed)
242245
243246
dir2/modified
247+
244248
Ignored files:
245249
(use "git add -f <file>..." to include in what will be committed)
246250
@@ -250,6 +254,7 @@ Ignored files:
250254
expect
251255
output
252256
untracked
257+
253258
EOF
254259
git status --ignored >output &&
255260
test_i18ncmp expect output
@@ -308,6 +313,7 @@ Ignored files:
308313
expect
309314
output
310315
untracked
316+
311317
EOF
312318
git status --ignored >output &&
313319
test_i18ncmp expect output
@@ -430,6 +436,7 @@ Untracked files:
430436
expect
431437
output
432438
untracked
439+
433440
EOF
434441
git status -unormal >output &&
435442
test_i18ncmp expect output
@@ -488,6 +495,7 @@ Untracked files:
488495
expect
489496
output
490497
untracked
498+
491499
EOF
492500
git status -uall >output &&
493501
test_i18ncmp expect output
@@ -548,6 +556,7 @@ Untracked files:
548556
../expect
549557
../output
550558
../untracked
559+
551560
EOF
552561
(cd dir1 && git status) >output &&
553562
test_i18ncmp expect output
@@ -618,6 +627,7 @@ Untracked files:
618627
<BLUE>expect<RESET>
619628
<BLUE>output<RESET>
620629
<BLUE>untracked<RESET>
630+
621631
EOF
622632
test_config color.ui always &&
623633
git status | test_decode_color >output &&
@@ -747,6 +757,7 @@ Untracked files:
747757
expect
748758
output
749759
untracked
760+
750761
EOF
751762
test_config status.relativePaths false &&
752763
(cd dir1 && git status) >output &&
@@ -789,6 +800,7 @@ Untracked files:
789800
expect
790801
output
791802
untracked
803+
792804
EOF
793805
git commit --dry-run dir1/modified >output &&
794806
test_i18ncmp expect output
@@ -838,6 +850,7 @@ Untracked files:
838850
expect
839851
output
840852
untracked
853+
841854
EOF
842855
git status >output &&
843856
test_i18ncmp expect output
@@ -902,6 +915,7 @@ Untracked files:
902915
expect
903916
output
904917
untracked
918+
905919
EOF
906920
git config status.submodulesummary 10 &&
907921
git status >output &&
@@ -952,6 +966,7 @@ Untracked files:
952966
expect
953967
output
954968
untracked
969+
955970
no changes added to commit (use "git add" and/or "git commit -a")
956971
EOF
957972
git commit -m "commit submodule" &&
@@ -1012,6 +1027,7 @@ Untracked files:
10121027
expect
10131028
output
10141029
untracked
1030+
10151031
EOF
10161032
git config status.submodulesummary 10 &&
10171033
git commit --dry-run --amend >output &&
@@ -1066,6 +1082,7 @@ Untracked files:
10661082
expect
10671083
output
10681084
untracked
1085+
10691086
EOF
10701087
echo modified sm/untracked &&
10711088
git status --ignore-submodules=untracked >output &&
@@ -1177,6 +1194,7 @@ Untracked files:
11771194
expect
11781195
output
11791196
untracked
1197+
11801198
EOF
11811199
git status --ignore-submodules=untracked > output &&
11821200
test_i18ncmp expect output
@@ -1238,6 +1256,7 @@ Untracked files:
12381256
expect
12391257
output
12401258
untracked
1259+
12411260
EOF
12421261
git status --ignore-submodules=untracked > output &&
12431262
test_i18ncmp expect output
@@ -1319,6 +1338,7 @@ cat > expect << EOF
13191338
; expect
13201339
; output
13211340
; untracked
1341+
;
13221342
EOF
13231343

13241344
test_expect_success "status (core.commentchar with submodule summary)" '
@@ -1352,6 +1372,7 @@ Untracked files:
13521372
expect
13531373
output
13541374
untracked
1375+
13551376
no changes added to commit (use "git add" and/or "git commit -a")
13561377
EOF
13571378
git status --ignore-submodules=all > output &&

wt-status.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -751,7 +751,7 @@ static void wt_status_print_other(struct wt_status *s,
751751

752752
strbuf_release(&buf);
753753
if (!column_active(s->colopts))
754-
return;
754+
goto conclude;
755755

756756
strbuf_addf(&buf, "%s%s\t%s",
757757
color(WT_STATUS_HEADER, s),
@@ -765,6 +765,8 @@ static void wt_status_print_other(struct wt_status *s,
765765
print_columns(&output, s->colopts, &copts);
766766
string_list_clear(&output, 0);
767767
strbuf_release(&buf);
768+
conclude:
769+
status_printf_ln(s, GIT_COLOR_NORMAL, "");
768770
}
769771

770772
static void wt_status_print_verbose(struct wt_status *s)

0 commit comments

Comments
 (0)