threads / patch / 7909

patchFix read_mailmap to handle a caller uninterested in repo abbreviation

Subject: [PATCH] Fix read_mailmap to handle a caller uninterested in repo abbreviation

## tl;dr

One message between Apr 30, 2007 and Apr 30, 2007. Diffs are folded; open one to read it.

replies: 0people: 1as markdown or json

Alex Riesen· Apr 30, 2007, 22:26 UTC · lore

The only such a caller builtin-blame.c would pass NULL as the place where to store the abbreviation.

Signed-off-by: Alex Riesen <raa.lkml@gmail.com>
---

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(-)
Show changes to mailmap.c +3 −0
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

← back to recent threads