Skip to content

Commit 738c218

Browse files
committed
Merge branch 'tr/void-diff-setup-done' into maint-1.7.11
* tr/void-diff-setup-done: diff_setup_done(): return void
2 parents 3f83594 + 2845265 commit 738c218

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
@@ -407,8 +407,7 @@ static struct origin *find_origin(struct scoreboard *sb,
407407
paths[1] = NULL;
408408

409409
diff_tree_setup_paths(paths, &diff_opts);
410-
if (diff_setup_done(&diff_opts) < 0)
411-
die("diff-setup");
410+
diff_setup_done(&diff_opts);
412411

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

500498
if (is_null_sha1(origin->commit->object.sha1))
501499
do_diff_cache(parent->tree->object.sha1, &diff_opts);
@@ -1075,8 +1073,7 @@ static int find_copy_in_parent(struct scoreboard *sb,
10751073

10761074
paths[0] = NULL;
10771075
diff_tree_setup_paths(paths, &diff_opts);
1078-
if (diff_setup_done(&diff_opts) < 0)
1079-
die("diff-setup");
1076+
diff_setup_done(&diff_opts);
10801077

10811078
/* Try "find copies harder" on new path if requested;
10821079
* 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
@@ -315,8 +315,7 @@ static void show_local_changes(struct object *head, struct diff_options *opts)
315315
init_revisions(&rev, NULL);
316316
rev.diffopt.flags = opts->flags;
317317
rev.diffopt.output_format |= DIFF_FORMAT_NAME_STATUS;
318-
if (diff_setup_done(&rev.diffopt) < 0)
319-
die(_("diff_setup_done failed"));
318+
diff_setup_done(&rev.diffopt);
320319
add_pending_object(&rev, head, NULL);
321320
run_diff_index(&rev, 0);
322321
}

builtin/diff.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -302,8 +302,7 @@ int cmd_diff(int argc, const char **argv, const char *prefix)
302302
argc = setup_revisions(argc, argv, &rev, NULL);
303303
if (!rev.diffopt.output_format) {
304304
rev.diffopt.output_format = DIFF_FORMAT_PATCH;
305-
if (diff_setup_done(&rev.diffopt) < 0)
306-
die(_("diff_setup_done failed"));
305+
diff_setup_done(&rev.diffopt);
307306
}
308307

309308
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
@@ -246,7 +246,7 @@ extern int git_diff_ui_config(const char *var, const char *value, void *cb);
246246
extern int diff_use_color_default;
247247
extern void diff_setup(struct diff_options *);
248248
extern int diff_opt_parse(struct diff_options *, const char **, int);
249-
extern int diff_setup_done(struct diff_options *);
249+
extern void diff_setup_done(struct diff_options *);
250250

251251
#define DIFF_DETECT_RENAME 1
252252
#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)