Skip to content

Commit 9cd33bb

Browse files
committed
Merge branch 'tr/void-diff-setup-done'
Remove unnecessary code. * tr/void-diff-setup-done: diff_setup_done(): return void
2 parents 8d35c11 + 2845265 commit 9cd33bb

File tree

13 files changed

+16
-32
lines changed

13 files changed

+16
-32
lines changed

builtin/blame.c

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -406,8 +406,7 @@ static struct origin *find_origin(struct scoreboard *sb,
406406
paths[1] = NULL;
407407

408408
diff_tree_setup_paths(paths, &diff_opts);
409-
if (diff_setup_done(&diff_opts) < 0)
410-
die("diff-setup");
409+
diff_setup_done(&diff_opts);
411410

412411
if (is_null_sha1(origin->commit->object.sha1))
413412
do_diff_cache(parent->tree->object.sha1, &diff_opts);
@@ -493,8 +492,7 @@ static struct origin *find_rename(struct scoreboard *sb,
493492
diff_opts.single_follow = origin->path;
494493
paths[0] = NULL;
495494
diff_tree_setup_paths(paths, &diff_opts);
496-
if (diff_setup_done(&diff_opts) < 0)
497-
die("diff-setup");
495+
diff_setup_done(&diff_opts);
498496

499497
if (is_null_sha1(origin->commit->object.sha1))
500498
do_diff_cache(parent->tree->object.sha1, &diff_opts);
@@ -1074,8 +1072,7 @@ static int find_copy_in_parent(struct scoreboard *sb,
10741072

10751073
paths[0] = NULL;
10761074
diff_tree_setup_paths(paths, &diff_opts);
1077-
if (diff_setup_done(&diff_opts) < 0)
1078-
die("diff-setup");
1075+
diff_setup_done(&diff_opts);
10791076

10801077
/* Try "find copies harder" on new path if requested;
10811078
* we do not want to use diffcore_rename() actually to

builtin/checkout.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -316,8 +316,7 @@ static void show_local_changes(struct object *head, struct diff_options *opts)
316316
init_revisions(&rev, NULL);
317317
rev.diffopt.flags = opts->flags;
318318
rev.diffopt.output_format |= DIFF_FORMAT_NAME_STATUS;
319-
if (diff_setup_done(&rev.diffopt) < 0)
320-
die(_("diff_setup_done failed"));
319+
diff_setup_done(&rev.diffopt);
321320
add_pending_object(&rev, head, NULL);
322321
run_diff_index(&rev, 0);
323322
}

builtin/diff.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -298,8 +298,7 @@ int cmd_diff(int argc, const char **argv, const char *prefix)
298298
argc = setup_revisions(argc, argv, &rev, NULL);
299299
if (!rev.diffopt.output_format) {
300300
rev.diffopt.output_format = DIFF_FORMAT_PATCH;
301-
if (diff_setup_done(&rev.diffopt) < 0)
302-
die(_("diff_setup_done failed"));
301+
diff_setup_done(&rev.diffopt);
303302
}
304303

305304
DIFF_OPT_SET(&rev.diffopt, RECURSIVE);

builtin/merge.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -404,8 +404,7 @@ static void finish(struct commit *head_commit,
404404
opts.output_format |=
405405
DIFF_FORMAT_SUMMARY | DIFF_FORMAT_DIFFSTAT;
406406
opts.detect_rename = DIFF_DETECT_RENAME;
407-
if (diff_setup_done(&opts) < 0)
408-
die(_("diff_setup_done failed"));
407+
diff_setup_done(&opts);
409408
diff_tree_sha1(head, new_head, "", &opts);
410409
diffcore_std(&opts);
411410
diff_flush(&opts);

diff-no-index.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -258,8 +258,7 @@ void diff_no_index(struct rev_info *revs,
258258
DIFF_OPT_SET(&revs->diffopt, NO_INDEX);
259259

260260
revs->max_count = -2;
261-
if (diff_setup_done(&revs->diffopt) < 0)
262-
die("diff_setup_done failed");
261+
diff_setup_done(&revs->diffopt);
263262

264263
setup_diff_pager(&revs->diffopt);
265264
DIFF_OPT_SET(&revs->diffopt, EXIT_WITH_STATUS);

diff.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3187,7 +3187,7 @@ void diff_setup(struct diff_options *options)
31873187
}
31883188
}
31893189

3190-
int diff_setup_done(struct diff_options *options)
3190+
void diff_setup_done(struct diff_options *options)
31913191
{
31923192
int count = 0;
31933193

@@ -3286,8 +3286,6 @@ int diff_setup_done(struct diff_options *options)
32863286
options->output_format = DIFF_FORMAT_NO_OUTPUT;
32873287
DIFF_OPT_SET(options, EXIT_WITH_STATUS);
32883288
}
3289-
3290-
return 0;
32913289
}
32923290

32933291
static int opt_arg(const char *arg, int arg_short, const char *arg_long, int *val)

diff.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -241,7 +241,7 @@ extern int git_diff_ui_config(const char *var, const char *value, void *cb);
241241
extern int diff_use_color_default;
242242
extern void diff_setup(struct diff_options *);
243243
extern int diff_opt_parse(struct diff_options *, const char **, int);
244-
extern int diff_setup_done(struct diff_options *);
244+
extern void diff_setup_done(struct diff_options *);
245245

246246
#define DIFF_DETECT_RENAME 1
247247
#define DIFF_DETECT_COPY 2

merge-recursive.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -493,8 +493,7 @@ static struct string_list *get_renames(struct merge_options *o,
493493
opts.rename_score = o->rename_score;
494494
opts.show_rename_progress = o->show_rename_progress;
495495
opts.output_format = DIFF_FORMAT_NO_OUTPUT;
496-
if (diff_setup_done(&opts) < 0)
497-
die(_("diff setup failed"));
496+
diff_setup_done(&opts);
498497
diff_tree_sha1(o_tree->object.sha1, tree->object.sha1, "", &opts);
499498
diffcore_std(&opts);
500499
if (opts.needed_rename_limit > o->needed_rename_limit)

notes-merge.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -126,8 +126,7 @@ static struct notes_merge_pair *diff_tree_remote(struct notes_merge_options *o,
126126
diff_setup(&opt);
127127
DIFF_OPT_SET(&opt, RECURSIVE);
128128
opt.output_format = DIFF_FORMAT_NO_OUTPUT;
129-
if (diff_setup_done(&opt) < 0)
130-
die("diff_setup_done failed");
129+
diff_setup_done(&opt);
131130
diff_tree_sha1(base, remote, "", &opt);
132131
diffcore_std(&opt);
133132

@@ -190,8 +189,7 @@ static void diff_tree_local(struct notes_merge_options *o,
190189
diff_setup(&opt);
191190
DIFF_OPT_SET(&opt, RECURSIVE);
192191
opt.output_format = DIFF_FORMAT_NO_OUTPUT;
193-
if (diff_setup_done(&opt) < 0)
194-
die("diff_setup_done failed");
192+
diff_setup_done(&opt);
195193
diff_tree_sha1(base, local, "", &opt);
196194
diffcore_std(&opt);
197195

patch-ids.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,7 @@ int init_patch_ids(struct patch_ids *ids)
3939
memset(ids, 0, sizeof(*ids));
4040
diff_setup(&ids->diffopts);
4141
DIFF_OPT_SET(&ids->diffopts, RECURSIVE);
42-
if (diff_setup_done(&ids->diffopts) < 0)
43-
return error("diff_setup_done failed");
42+
diff_setup_done(&ids->diffopts);
4443
return 0;
4544
}
4645

0 commit comments

Comments
 (0)