X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=wt-status.c;h=5807fc3211a3aa8f886694776fe8c86b5bc5eb59;hb=b10a53583f5725b796de630c946e41bbd48fcfe2;hp=65feb29f2ee87b85a21907c5087cfcdd6c3be756;hpb=1a545d0b5fa56a7be88fe082cec7847715079a18;p=git.git diff --git a/wt-status.c b/wt-status.c index 65feb29f2..5807fc321 100644 --- a/wt-status.c +++ b/wt-status.c @@ -459,7 +459,7 @@ static void wt_status_print_changed(struct wt_status *s) wt_status_print_trailer(s); } -static void wt_status_print_submodule_summary(struct wt_status *s) +static void wt_status_print_submodule_summary(struct wt_status *s, int uncommitted) { struct child_process sm_summary; char summary_limit[64]; @@ -468,11 +468,11 @@ static void wt_status_print_submodule_summary(struct wt_status *s) const char *argv[] = { "submodule", "summary", - "--cached", + uncommitted ? "--files" : "--cached", "--for-status", "--summary-limit", summary_limit, - s->amend ? "HEAD^" : "HEAD", + uncommitted ? NULL : (s->amend ? "HEAD^" : "HEAD"), NULL }; @@ -580,8 +580,10 @@ void wt_status_print(struct wt_status *s) wt_status_print_updated(s); wt_status_print_unmerged(s); wt_status_print_changed(s); - if (s->submodule_summary) - wt_status_print_submodule_summary(s); + if (s->submodule_summary) { + wt_status_print_submodule_summary(s, 0); /* staged */ + wt_status_print_submodule_summary(s, 1); /* unstaged */ + } if (s->show_untracked_files) wt_status_print_untracked(s); else if (s->commitable)