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 <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
maint
Jeff King 2020-06-23 11:25:01 -04:00 committed by Junio C Hamano
parent 55b01456a9
commit 6416a865da
1 changed files with 1 additions and 1 deletions

View File

@ -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;