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 <johannes.schindelin@gmx.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Johannes Schindelin committed
Aug 13, 2018 at 04:33 UTC
4eba1fe6156739e69e8cf3c1e84a9f050d91a884
1 file changed
+6
range-diff.c
+6
@@ -9,6 +9,7 @@
9
#include "diffcore.h"
10
#include "commit.h"
11
#include "pretty.h"
12
+#include "userdiff.h"
13
14
struct patch_util {
15
/* For the search for an exact match */
@@ -302,6 +303,10 @@ static void output_pair_header(struct strbuf *buf,
303
fwrite(buf->buf, buf->len, 1, stdout);
304
}
305
306
+static struct userdiff_driver no_func_name = {
307
+ .funcname = { "$^", 0 }
308
+};
309
+
310
static struct diff_filespec *get_filespec(const char *name, const char *p)
311
{
312
struct diff_filespec *spec = alloc_filespec(name);
@@ -311,6 +316,7 @@ static struct diff_filespec *get_filespec(const char *name, const char *p)
316
spec->size = strlen(p);
317
spec->should_munmap = 0;
318
spec->is_stdin = 1;
319
+ spec->driver = &no_func_name;
320
321
return spec;
322
}