On Tue, Apr 17, 2018 at 11:06 PM, Samuel Lijin <sxlijin@xxxxxxxxx> wrote: > Make invoking `git commit` with `--short` or `--porcelain` return status > code zero when there is something to commit. > > Mark the commitable flag in the wt_status object in the call to > `wt_status_collect()`, instead of in `wt_longstatus_print_updated()`, > and simplify the logic in the latter function to take advantage of the > logic shifted to the former. > > Signed-off-by: Samuel Lijin <sxlijin@xxxxxxxxx> > --- > diff --git a/wt-status.c b/wt-status.c > @@ -754,26 +770,25 @@ static void wt_longstatus_print_unmerged(struct wt_status *s) > static void wt_longstatus_print_updated(struct wt_status *s) > { > - int shown_header = 0; > - int i; > + if (!s->commitable) { > + return; > + } > + > + wt_longstatus_print_cached_header(s); > > + int i; > for (i = 0; i < s->change.nr; i++) { Declaration after statement: Declare 'i' at the top of the function as it was before this patch.