diff options
author | Thomas Rast <trast@student.ethz.ch> | 2009-10-19 17:48:08 +0200 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2009-10-19 22:28:20 -0700 |
commit | dd2e794a214350711db46c4e08d9b19188a7d63a (patch) | |
tree | d9566af4d6b5eac1ba0fa0f1e6e3a3b08d56b858 /builtin-show-branch.c | |
parent | 9ecb2a7f496413b9a6404e4a19f7edee029819b8 (diff) | |
download | git-dd2e794a214350711db46c4e08d9b19188a7d63a.tar.gz |
Refactor pretty_print_commit arguments into a struct
pretty_print_commit() has a bunch of rarely-used arguments, and
introducing more of them requires yet another update of all the call
sites. Refactor most of them into a struct to make future extensions
easier.
The ones that stay "plain" arguments were chosen on the grounds that
all callers put real arguments there, whereas some callers have 0/NULL
for all arguments that were factored into the struct.
We declare the struct 'const' to ensure none of the callers are bitten
by the changed (no longer call-by-value) semantics.
Signed-off-by: Thomas Rast <trast@student.ethz.ch>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin-show-branch.c')
-rw-r--r-- | builtin-show-branch.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/builtin-show-branch.c b/builtin-show-branch.c index be95930b78..9f13caa76d 100644 --- a/builtin-show-branch.c +++ b/builtin-show-branch.c @@ -293,8 +293,8 @@ static void show_one_commit(struct commit *commit, int no_name) struct commit_name *name = commit->util; if (commit->object.parsed) { - pretty_print_commit(CMIT_FMT_ONELINE, commit, - &pretty, 0, NULL, NULL, 0, 0); + struct pretty_print_context ctx = {0}; + pretty_print_commit(CMIT_FMT_ONELINE, commit, &pretty, &ctx); pretty_str = pretty.buf; } if (!prefixcmp(pretty_str, "[PATCH] ")) |