From 6416a865da44ac8e27e5dbcafd6a8b76caf09f5a Mon Sep 17 00:00:00 2001 From: Jeff King Date: Tue, 23 Jun 2020 11:25:01 -0400 Subject: fast-export: move global "idents" anonymize hashmap into function All of the other anonymization functions keep their static mappings inside the function to avoid polluting the global namespace. Let's do the same for "idents", as nobody needs it outside of anonymize_ident_line(). Signed-off-by: Jeff King Signed-off-by: Junio C Hamano --- builtin/fast-export.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/builtin/fast-export.c b/builtin/fast-export.c index 99d4a2b404..16a1563e49 100644 --- a/builtin/fast-export.c +++ b/builtin/fast-export.c @@ -555,7 +555,6 @@ static char *anonymize_commit_message(const char *old) return xstrfmt("subject %d\n\nbody\n", counter++); } -static struct hashmap idents; static char *anonymize_ident(const char *old, size_t len) { static int counter; @@ -572,6 +571,7 @@ static char *anonymize_ident(const char *old, size_t len) */ static void anonymize_ident_line(const char **beg, const char **end) { + static struct hashmap idents; static struct strbuf buffers[] = { STRBUF_INIT, STRBUF_INIT }; static unsigned which_buffer; -- cgit v1.2.3