Skip to content

Commit a02bdb8

Browse files
committed
range-diff: do not show "function names" in hunk headers
We are comparing complete, formatted commit messages with patches. There are no function names here, so stop looking for them. Signed-off-by: Johannes Schindelin <[email protected]>
1 parent 909a194 commit a02bdb8

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

range-diff.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
#include "diffcore.h"
1010
#include "commit.h"
1111
#include "pretty.h"
12+
#include "userdiff.h"
1213

1314
struct patch_util {
1415
/* For the search for an exact match */
@@ -308,6 +309,10 @@ static void output_pair_header(struct strbuf *buf,
308309
fwrite(buf->buf, buf->len, 1, stdout);
309310
}
310311

312+
static struct userdiff_driver no_func_name = {
313+
.funcname = { "$^", 0 }
314+
};
315+
311316
static struct diff_filespec *get_filespec(const char *name, const char *p)
312317
{
313318
struct diff_filespec *spec = alloc_filespec(name);
@@ -317,6 +322,7 @@ static struct diff_filespec *get_filespec(const char *name, const char *p)
317322
spec->size = strlen(p);
318323
spec->should_munmap = 0;
319324
spec->is_stdin = 1;
325+
spec->driver = &no_func_name;
320326

321327
return spec;
322328
}

0 commit comments

Comments
 (0)