summaryrefslogtreecommitdiff
path: root/wt-status.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2010-01-22 16:08:10 -0800
committerJunio C Hamano <gitster@pobox.com>2010-01-22 16:08:10 -0800
commitc6ec7efdd4c63f5c53184651cb05748e7bc71075 (patch)
tree4f9d0de8273ca2d608e172367b167c0b1774b05c /wt-status.c
parent16735ae0f8a8e2df5e54807fd0a5930eb97dcb7a (diff)
parente3d42c4773bccebb50f01b108d20b06c6a11e615 (diff)
downloadgit-c6ec7efdd4c63f5c53184651cb05748e7bc71075.tar.gz
Merge branch 'jl/submodule-diff'
* jl/submodule-diff: Performance optimization for detection of modified submodules git status: Show uncommitted submodule changes too when enabled Teach diff that modified submodule directory is dirty Show submodules as modified when they contain a dirty work tree
Diffstat (limited to 'wt-status.c')
-rw-r--r--wt-status.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/wt-status.c b/wt-status.c
index 65feb29f2e..5807fc3211 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)