[PATCH] Fix read_mailmap to handle a caller uninterested in repo abbreviation
From: Alex Riesen <hidden>
Date: 2016-06-15 22:43:07
Subsystem:
the rest · Maintainer:
Linus Torvalds
From: Alex Riesen <hidden>
Date: 2016-06-15 22:43:07
Subsystem:
the rest · Maintainer:
Linus Torvalds
The only such a caller builtin-blame.c would pass NULL as the place where to store the abbreviation. Signed-off-by: Alex Riesen <redacted> --- No one seem to be using the feature. No wonder: it has exotic use case, strange configuration, not documented, there is only one call site (shortlog), and there, why does it not happen automatically anyway? mailmap.c | 3 +++ 1 files changed, 3 insertions(+), 0 deletions(-)
diff --git a/mailmap.c b/mailmap.c
index c29e4e5..38359a2 100644
--- a/mailmap.c
+++ b/mailmap.c@@ -17,6 +17,9 @@ int read_mailmap(struct path_list *map, const char *filename, char **repo_abbrev int abblen = sizeof(abbrev) - 1; int len = strlen(buffer); + if (!repo_abbrev) + continue; + if (len && buffer[len - 1] == '\n') buffer[--len] = 0; if (!strncmp(buffer, abbrev, abblen)) {
--
1.5.2.rc0.792.g7f4bd0