@@ -139,38 +139,64 @@ void status_subcommand::run()
139
139
// output_format = 3;
140
140
// }
141
141
142
+ bool is_long;
143
+ is_long = ((of == output_format::DEFAULT) || (of == output_format::LONG));
142
144
if (sl.has_tobecommited_header ())
143
145
{
144
- std::cout << tobecommited_header << std::endl;
146
+ if (is_long)
147
+ {
148
+ std::cout << tobecommited_header << std::endl;
149
+ }
145
150
print_entries (GIT_STATUS_INDEX_NEW, sl, true , of);
146
151
print_entries (GIT_STATUS_INDEX_MODIFIED, sl, true , of);
147
152
print_entries (GIT_STATUS_INDEX_DELETED, sl, true , of);
148
153
print_entries (GIT_STATUS_INDEX_RENAMED, sl, true , of);
149
154
print_entries (GIT_STATUS_INDEX_TYPECHANGE, sl, true , of);
150
- std::cout << std::endl;
155
+ if (is_long)
156
+ {
157
+ std::cout << std::endl;
158
+ }
151
159
}
152
160
153
161
if (sl.has_notstagged_header ())
154
162
{
155
- std::cout << notstagged_header << std::endl;
163
+ if (is_long)
164
+ {
165
+ std::cout << notstagged_header << std::endl;
166
+ }
156
167
print_entries (GIT_STATUS_WT_MODIFIED, sl, false , of);
157
168
print_entries (GIT_STATUS_WT_DELETED, sl, false , of);
158
169
print_entries (GIT_STATUS_WT_TYPECHANGE, sl, false , of);
159
170
print_entries (GIT_STATUS_WT_RENAMED, sl, false , of);
160
- std::cout << std::endl;
171
+ if (is_long)
172
+ {
173
+ std::cout << std::endl;
174
+ }
161
175
}
162
176
163
177
if (sl.has_untracked_header ())
164
178
{
165
- std::cout << untracked_header << std::endl;
179
+ if (is_long)
180
+ {
181
+ std::cout << untracked_header << std::endl;
182
+ }
166
183
print_entries (GIT_STATUS_WT_NEW, sl, false , of);
167
- std::cout << std::endl;
184
+ if (is_long)
185
+ {
186
+ std::cout << std::endl;
187
+ }
168
188
}
169
189
170
190
if (sl.has_ignored_header ())
171
191
{
172
- std::cout << ignored_header << std::endl;
192
+ if (is_long)
193
+ {
194
+ std::cout << ignored_header << std::endl;
195
+ }
173
196
print_entries (GIT_STATUS_IGNORED, sl, false , of);
174
- std::cout << std::endl;
197
+ if (is_long)
198
+ {
199
+ std::cout << std::endl;
200
+ }
175
201
}
176
202
}
0 commit comments