summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--builtin/blame.c9
-rw-r--r--builtin/checkout.c3
-rw-r--r--builtin/diff.c3
-rw-r--r--builtin/merge.c3
-rw-r--r--diff-no-index.c3
-rw-r--r--diff.c4
-rw-r--r--diff.h2
-rw-r--r--merge-recursive.c3
-rw-r--r--notes-merge.c6
-rw-r--r--patch-ids.c3
-rw-r--r--revision.c3
-rw-r--r--submodule.c3
-rw-r--r--tree-diff.c3
13 files changed, 16 insertions, 32 deletions
diff --git a/builtin/blame.c b/builtin/blame.c
index 0d50273ce9..48dbfa4304 100644
--- a/builtin/blame.c
+++ b/builtin/blame.c
@@ -406,8 +406,7 @@ static struct origin *find_origin(struct scoreboard *sb,
paths[1] = NULL;
diff_tree_setup_paths(paths, &diff_opts);
- if (diff_setup_done(&diff_opts) < 0)
- die("diff-setup");
+ diff_setup_done(&diff_opts);
if (is_null_sha1(origin->commit->object.sha1))
do_diff_cache(parent->tree->object.sha1, &diff_opts);
@@ -493,8 +492,7 @@ static struct origin *find_rename(struct scoreboard *sb,
diff_opts.single_follow = origin->path;
paths[0] = NULL;
diff_tree_setup_paths(paths, &diff_opts);
- if (diff_setup_done(&diff_opts) < 0)
- die("diff-setup");
+ diff_setup_done(&diff_opts);
if (is_null_sha1(origin->commit->object.sha1))
do_diff_cache(parent->tree->object.sha1, &diff_opts);
@@ -1074,8 +1072,7 @@ static int find_copy_in_parent(struct scoreboard *sb,
paths[0] = NULL;
diff_tree_setup_paths(paths, &diff_opts);
- if (diff_setup_done(&diff_opts) < 0)
- die("diff-setup");
+ diff_setup_done(&diff_opts);
/* Try "find copies harder" on new path if requested;
* we do not want to use diffcore_rename() actually to
diff --git a/builtin/checkout.c b/builtin/checkout.c
index d812219b30..7d922c612a 100644
--- a/builtin/checkout.c
+++ b/builtin/checkout.c
@@ -316,8 +316,7 @@ static void show_local_changes(struct object *head, struct diff_options *opts)
init_revisions(&rev, NULL);
rev.diffopt.flags = opts->flags;
rev.diffopt.output_format |= DIFF_FORMAT_NAME_STATUS;
- if (diff_setup_done(&rev.diffopt) < 0)
- die(_("diff_setup_done failed"));
+ diff_setup_done(&rev.diffopt);
add_pending_object(&rev, head, NULL);
run_diff_index(&rev, 0);
}
diff --git a/builtin/diff.c b/builtin/diff.c
index da8f6aac2b..ecfdd1b6df 100644
--- a/builtin/diff.c
+++ b/builtin/diff.c
@@ -298,8 +298,7 @@ int cmd_diff(int argc, const char **argv, const char *prefix)
argc = setup_revisions(argc, argv, &rev, NULL);
if (!rev.diffopt.output_format) {
rev.diffopt.output_format = DIFF_FORMAT_PATCH;
- if (diff_setup_done(&rev.diffopt) < 0)
- die(_("diff_setup_done failed"));
+ diff_setup_done(&rev.diffopt);
}
DIFF_OPT_SET(&rev.diffopt, RECURSIVE);
diff --git a/builtin/merge.c b/builtin/merge.c
index dd50a0c57b..e81fde6d79 100644
--- a/builtin/merge.c
+++ b/builtin/merge.c
@@ -404,8 +404,7 @@ static void finish(struct commit *head_commit,
opts.output_format |=
DIFF_FORMAT_SUMMARY | DIFF_FORMAT_DIFFSTAT;
opts.detect_rename = DIFF_DETECT_RENAME;
- if (diff_setup_done(&opts) < 0)
- die(_("diff_setup_done failed"));
+ diff_setup_done(&opts);
diff_tree_sha1(head, new_head, "", &opts);
diffcore_std(&opts);
diff_flush(&opts);
diff --git a/diff-no-index.c b/diff-no-index.c
index 7d805a06af..b34b5aa7df 100644
--- a/diff-no-index.c
+++ b/diff-no-index.c
@@ -258,8 +258,7 @@ void diff_no_index(struct rev_info *revs,
DIFF_OPT_SET(&revs->diffopt, NO_INDEX);
revs->max_count = -2;
- if (diff_setup_done(&revs->diffopt) < 0)
- die("diff_setup_done failed");
+ diff_setup_done(&revs->diffopt);
setup_diff_pager(&revs->diffopt);
DIFF_OPT_SET(&revs->diffopt, EXIT_WITH_STATUS);
diff --git a/diff.c b/diff.c
index 95706a5b40..259118d258 100644
--- a/diff.c
+++ b/diff.c
@@ -3187,7 +3187,7 @@ void diff_setup(struct diff_options *options)
}
}
-int diff_setup_done(struct diff_options *options)
+void diff_setup_done(struct diff_options *options)
{
int count = 0;
@@ -3286,8 +3286,6 @@ int diff_setup_done(struct diff_options *options)
options->output_format = DIFF_FORMAT_NO_OUTPUT;
DIFF_OPT_SET(options, EXIT_WITH_STATUS);
}
-
- return 0;
}
static int opt_arg(const char *arg, int arg_short, const char *arg_long, int *val)
diff --git a/diff.h b/diff.h
index e027650cb0..66f8052e67 100644
--- a/diff.h
+++ b/diff.h
@@ -241,7 +241,7 @@ extern int git_diff_ui_config(const char *var, const char *value, void *cb);
extern int diff_use_color_default;
extern void diff_setup(struct diff_options *);
extern int diff_opt_parse(struct diff_options *, const char **, int);
-extern int diff_setup_done(struct diff_options *);
+extern void diff_setup_done(struct diff_options *);
#define DIFF_DETECT_RENAME 1
#define DIFF_DETECT_COPY 2
diff --git a/merge-recursive.c b/merge-recursive.c
index 3b24d930e2..7866ca1026 100644
--- a/merge-recursive.c
+++ b/merge-recursive.c
@@ -493,8 +493,7 @@ static struct string_list *get_renames(struct merge_options *o,
opts.rename_score = o->rename_score;
opts.show_rename_progress = o->show_rename_progress;
opts.output_format = DIFF_FORMAT_NO_OUTPUT;
- if (diff_setup_done(&opts) < 0)
- die(_("diff setup failed"));
+ diff_setup_done(&opts);
diff_tree_sha1(o_tree->object.sha1, tree->object.sha1, "", &opts);
diffcore_std(&opts);
if (opts.needed_rename_limit > o->needed_rename_limit)
diff --git a/notes-merge.c b/notes-merge.c
index 29c6411fc6..0f67bd3f96 100644
--- a/notes-merge.c
+++ b/notes-merge.c
@@ -126,8 +126,7 @@ static struct notes_merge_pair *diff_tree_remote(struct notes_merge_options *o,
diff_setup(&opt);
DIFF_OPT_SET(&opt, RECURSIVE);
opt.output_format = DIFF_FORMAT_NO_OUTPUT;
- if (diff_setup_done(&opt) < 0)
- die("diff_setup_done failed");
+ diff_setup_done(&opt);
diff_tree_sha1(base, remote, "", &opt);
diffcore_std(&opt);
@@ -190,8 +189,7 @@ static void diff_tree_local(struct notes_merge_options *o,
diff_setup(&opt);
DIFF_OPT_SET(&opt, RECURSIVE);
opt.output_format = DIFF_FORMAT_NO_OUTPUT;
- if (diff_setup_done(&opt) < 0)
- die("diff_setup_done failed");
+ diff_setup_done(&opt);
diff_tree_sha1(base, local, "", &opt);
diffcore_std(&opt);
diff --git a/patch-ids.c b/patch-ids.c
index 5717257051..bc8a28fdd7 100644
--- a/patch-ids.c
+++ b/patch-ids.c
@@ -39,8 +39,7 @@ int init_patch_ids(struct patch_ids *ids)
memset(ids, 0, sizeof(*ids));
diff_setup(&ids->diffopts);
DIFF_OPT_SET(&ids->diffopts, RECURSIVE);
- if (diff_setup_done(&ids->diffopts) < 0)
- return error("diff_setup_done failed");
+ diff_setup_done(&ids->diffopts);
return 0;
}
diff --git a/revision.c b/revision.c
index 9e8f47a25d..57eb0c0e13 100644
--- a/revision.c
+++ b/revision.c
@@ -1861,8 +1861,7 @@ int setup_revisions(int argc, const char **argv, struct rev_info *revs, struct s
if (revs->combine_merges)
revs->ignore_merges = 0;
revs->diffopt.abbrev = revs->abbrev;
- if (diff_setup_done(&revs->diffopt) < 0)
- die("diff_setup_done failed");
+ diff_setup_done(&revs->diffopt);
compile_grep_patterns(&revs->grep_filter);
diff --git a/submodule.c b/submodule.c
index 959d349ea7..19dc6a6c0d 100644
--- a/submodule.c
+++ b/submodule.c
@@ -574,8 +574,7 @@ static void calculate_changed_submodule_paths(void)
DIFF_OPT_SET(&diff_opts, RECURSIVE);
diff_opts.output_format |= DIFF_FORMAT_CALLBACK;
diff_opts.format_callback = submodule_collect_changed_cb;
- if (diff_setup_done(&diff_opts) < 0)
- die("diff_setup_done failed");
+ diff_setup_done(&diff_opts);
diff_tree_sha1(parent->item->object.sha1, commit->object.sha1, "", &diff_opts);
diffcore_std(&diff_opts);
diff_flush(&diff_opts);
diff --git a/tree-diff.c b/tree-diff.c
index 28ad6db9ff..f760740a11 100644
--- a/tree-diff.c
+++ b/tree-diff.c
@@ -212,8 +212,7 @@ static void try_to_follow_renames(struct tree_desc *t1, struct tree_desc *t2, co
diff_opts.rename_score = opt->rename_score;
paths[0] = NULL;
diff_tree_setup_paths(paths, &diff_opts);
- if (diff_setup_done(&diff_opts) < 0)
- die("unable to set up diff options to follow renames");
+ diff_setup_done(&diff_opts);
diff_tree(t1, t2, base, &diff_opts);
diffcore_std(&diff_opts);
diff_tree_release_paths(&diff_opts);