[07/10] fast-export: move global "idents" anonymize hashmap into function
diff mbox series

Message ID 20200623152501.GG1435482@coredump.intra.peff.net
State New
Headers show
  • fast-export: allow seeding the anonymized mapping
Related show

Commit Message

Jeff King June 23, 2020, 3:25 p.m. UTC
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

Signed-off-by: Jeff King <peff@peff.net>
 builtin/fast-export.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff mbox series

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;