Stefan Beller wrote: > --- a/submodule.c > +++ b/submodule.c > @@ -1075,16 +1075,15 @@ unsigned is_submodule_modified(const char *path, int ignore_untracked) > len = strbuf_read(&buf, cp.out, 1024); > line = buf.buf; > while (len > 2) { > - if ((line[0] == '?') && (line[1] == '?')) { > + if ((line[0] == '?') && (line[1] == '?')) > dirty_submodule |= DIRTY_SUBMODULE_UNTRACKED; > - if (dirty_submodule & DIRTY_SUBMODULE_MODIFIED) > - break; > - } else { > + else > dirty_submodule |= DIRTY_SUBMODULE_MODIFIED; > - if (ignore_untracked || > - (dirty_submodule & DIRTY_SUBMODULE_UNTRACKED)) > - break; > - } > + > + if ((dirty_submodule & DIRTY_SUBMODULE_MODIFIED) && > + ((dirty_submodule & DIRTY_SUBMODULE_UNTRACKED) || ignore_untracked)) nit: long line Reviewed-by: Jonathan Nieder <jrnieder@xxxxxxxxx> diff --git i/submodule.c w/submodule.c index aba89661a7..8934d97359 100644 --- i/submodule.c +++ w/submodule.c @@ -1087,8 +1087,10 @@ unsigned is_submodule_modified(const char *path, int ignore_untracked) dirty_submodule |= DIRTY_SUBMODULE_MODIFIED; if ((dirty_submodule & DIRTY_SUBMODULE_MODIFIED) && - ((dirty_submodule & DIRTY_SUBMODULE_UNTRACKED) || ignore_untracked)) + (ignore_untracked + || (dirty_submodule & DIRTY_SUBMODULE_UNTRACKED))) { break; + } next_line = strchr(line, '\n'); if (!next_line)