Skip to content

Commit 6416a86

Browse files
peffgitster
authored andcommitted
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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 55b0145 commit 6416a86

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

builtin/fast-export.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -555,7 +555,6 @@ static char *anonymize_commit_message(const char *old)
555555
return xstrfmt("subject %d\n\nbody\n", counter++);
556556
}
557557

558-
static struct hashmap idents;
559558
static char *anonymize_ident(const char *old, size_t len)
560559
{
561560
static int counter;
@@ -572,6 +571,7 @@ static char *anonymize_ident(const char *old, size_t len)
572571
*/
573572
static void anonymize_ident_line(const char **beg, const char **end)
574573
{
574+
static struct hashmap idents;
575575
static struct strbuf buffers[] = { STRBUF_INIT, STRBUF_INIT };
576576
static unsigned which_buffer;
577577

0 commit comments

Comments
 (0)