Skip to content

Commit d1c0fe8

Browse files
committed
Merge branch 'dl/range-diff-with-notes'
Code clean-up. * dl/range-diff-with-notes: range-diff: clear `other_arg` at end of function range-diff: mark pointers as const t3206: fix incorrect test name
2 parents 26c816a + abcf857 commit d1c0fe8

File tree

4 files changed

+7
-6
lines changed

4 files changed

+7
-6
lines changed

builtin/range-diff.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,7 @@ int cmd_range_diff(int argc, const char **argv, const char *prefix)
8484
res = show_range_diff(range1.buf, range2.buf, creation_factor,
8585
simple_color < 1, &diffopt, &other_arg);
8686

87+
argv_array_clear(&other_arg);
8788
strbuf_release(&range1);
8889
strbuf_release(&range2);
8990

range-diff.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ static size_t find_end_of_line(char *buffer, unsigned long size)
4141
* as struct object_id (will need to be free()d).
4242
*/
4343
static int read_patches(const char *range, struct string_list *list,
44-
struct argv_array *other_arg)
44+
const struct argv_array *other_arg)
4545
{
4646
struct child_process cp = CHILD_PROCESS_INIT;
4747
struct strbuf buf = STRBUF_INIT, contents = STRBUF_INIT;
@@ -506,8 +506,8 @@ static struct strbuf *output_prefix_cb(struct diff_options *opt, void *data)
506506

507507
int show_range_diff(const char *range1, const char *range2,
508508
int creation_factor, int dual_color,
509-
struct diff_options *diffopt,
510-
struct argv_array *other_arg)
509+
const struct diff_options *diffopt,
510+
const struct argv_array *other_arg)
511511
{
512512
int res = 0;
513513

range-diff.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
*/
1414
int show_range_diff(const char *range1, const char *range2,
1515
int creation_factor, int dual_color,
16-
struct diff_options *diffopt,
17-
struct argv_array *other_arg);
16+
const struct diff_options *diffopt,
17+
const struct argv_array *other_arg);
1818

1919
#endif

t/t3206-range-diff.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -638,7 +638,7 @@ test_expect_success 'format-patch --range-diff with --notes' '
638638
test_cmp expect actual
639639
'
640640

641-
test_expect_success 'format-patch --range-diff with --notes' '
641+
test_expect_success 'format-patch --range-diff with format.notes config' '
642642
git notes add -m "topic note" topic &&
643643
git notes add -m "unmodified note" unmodified &&
644644
test_when_finished git notes remove topic unmodified &&

0 commit comments

Comments
 (0)