Skip to content

Commit 4eba1fe

Browse files
dschogitster
authored andcommitted
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]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent eb0be38 commit 4eba1fe

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 */
@@ -302,6 +303,10 @@ static void output_pair_header(struct strbuf *buf,
302303
fwrite(buf->buf, buf->len, 1, stdout);
303304
}
304305

306+
static struct userdiff_driver no_func_name = {
307+
.funcname = { "$^", 0 }
308+
};
309+
305310
static struct diff_filespec *get_filespec(const char *name, const char *p)
306311
{
307312
struct diff_filespec *spec = alloc_filespec(name);
@@ -311,6 +316,7 @@ static struct diff_filespec *get_filespec(const char *name, const char *p)
311316
spec->size = strlen(p);
312317
spec->should_munmap = 0;
313318
spec->is_stdin = 1;
319+
spec->driver = &no_func_name;
314320

315321
return spec;
316322
}

0 commit comments

Comments
 (0)