]> git.ipfire.org Git - thirdparty/git.git/commitdiff
fast-export: move global "idents" anonymize hashmap into function
authorJeff King <peff@peff.net>
Tue, 23 Jun 2020 15:25:01 +0000 (11:25 -0400)
committerJunio C Hamano <gitster@pobox.com>
Wed, 24 Jun 2020 02:56:26 +0000 (19:56 -0700)
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>
builtin/fast-export.c

index 99d4a2b404063c99e4327697c2f9449a7451e4e0..16a1563e4971d625e1db95fa71a09406a303cf8b 100644 (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;