summaryrefslogtreecommitdiff
path: root/ll-merge.c
diff options
context:
space:
mode:
authorJonathan Nieder <jrnieder@gmail.com>2011-01-15 19:08:42 -0600
committerJunio C Hamano <gitster@pobox.com>2011-01-15 20:34:14 -0800
commit4fb40c2b8206f7bdffedd8d58d2f9c031227b01b (patch)
tree1a14bbf5c9369ebe428dc09ba0677bf1642c3ea8 /ll-merge.c
parentadf872e7837cc92e390f00ee32f32c5639d3a444 (diff)
downloadgit-4fb40c2b8206f7bdffedd8d58d2f9c031227b01b.tar.gz
ll-merge: simplify opts == NULL case
As long as sizeof(struct ll_merge_options) is small, there is not much reason not to keep a copy of the default merge options in the BSS section. In return, we get clearer code and one less stack frame in the opts == NULL case. Signed-off-by: Jonathan Nieder <jrnieder@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'll-merge.c')
-rw-r--r--ll-merge.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/ll-merge.c b/ll-merge.c
index 007dd3e4d3..6ce512efc4 100644
--- a/ll-merge.c
+++ b/ll-merge.c
@@ -351,16 +351,13 @@ int ll_merge(mmbuffer_t *result_buf,
const struct ll_merge_options *opts)
{
static struct git_attr_check check[2];
+ static const struct ll_merge_options default_opts;
const char *ll_driver_name = NULL;
int marker_size = DEFAULT_CONFLICT_MARKER_SIZE;
const struct ll_merge_driver *driver;
- if (!opts) {
- struct ll_merge_options default_opts = {0};
- return ll_merge(result_buf, path, ancestor, ancestor_label,
- ours, our_label, theirs, their_label,
- &default_opts);
- }
+ if (!opts)
+ opts = &default_opts;
if (opts->renormalize) {
normalize_file(ancestor, path);