diff options
author | René Scharfe <l.s.r@web.de> | 2014-06-29 22:55:44 +0200 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2014-06-29 23:41:04 -0700 |
commit | 10761eb6812bfe46c50360685916ae14859a2b85 (patch) | |
tree | c1a36c5e8015e70233643f293b286b66c30a1d27 /wt-status.c | |
parent | 85dd6bf4911dc6d08857c234fe3c135abeed2c44 (diff) | |
download | git-10761eb6812bfe46c50360685916ae14859a2b85.tar.gz |
wt-status: simplify building of summary limit argumentrs/status-code-clean-up
Use argv_array_pushf for building the number string for the option
--summary-limit directly instead of using an intermediate buffer.
Signed-off-by: Rene Scharfe <l.s.r@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'wt-status.c')
-rw-r--r-- | wt-status.c | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/wt-status.c b/wt-status.c index ed5db49502..4cd31be2bd 100644 --- a/wt-status.c +++ b/wt-status.c @@ -734,7 +734,6 @@ static void wt_status_print_changed(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]; struct argv_array env = ARGV_ARRAY_INIT; struct argv_array argv = ARGV_ARRAY_INIT; struct strbuf cmd_stdout = STRBUF_INIT; @@ -742,7 +741,6 @@ static void wt_status_print_submodule_summary(struct wt_status *s, int uncommitt char *summary_content; size_t len; - sprintf(summary_limit, "%d", s->submodule_summary); argv_array_pushf(&env, "GIT_INDEX_FILE=%s", s->index_file); argv_array_push(&argv, "submodule"); @@ -750,7 +748,7 @@ static void wt_status_print_submodule_summary(struct wt_status *s, int uncommitt argv_array_push(&argv, uncommitted ? "--files" : "--cached"); argv_array_push(&argv, "--for-status"); argv_array_push(&argv, "--summary-limit"); - argv_array_push(&argv, summary_limit); + argv_array_pushf(&argv, "%d", s->submodule_summary); if (!uncommitted) argv_array_push(&argv, s->amend ? "HEAD^" : "HEAD"); |