@@ -1718,8 +1718,6 @@ int author_ident_sufficiently_given(void);
extern const char *git_commit_encoding;
extern const char *git_log_output_encoding;
-extern const char *git_mailmap_file;
-extern const char *git_mailmap_blob;
/* IO helper functions */
void maybe_flush_or_die(FILE *, const char *);
@@ -15,6 +15,7 @@
#include "strbuf.h"
#include "quote.h"
#include "hashmap.h"
+#include "mailmap.h"
#include "string-list.h"
#include "object-store.h"
#include "utf8.h"
@@ -1603,17 +1604,6 @@ static int git_default_push_config(const char *var, const char *value)
return 0;
}
-static int git_default_mailmap_config(const char *var, const char *value)
-{
- if (!strcmp(var, "mailmap.file"))
- return git_config_pathname(&git_mailmap_file, var, value);
- if (!strcmp(var, "mailmap.blob"))
- return git_config_string(&git_mailmap_blob, var, value);
-
- /* Add other config variables here and to Documentation/config.txt. */
- return 0;
-}
-
int git_default_config(const char *var, const char *value, void *cb)
{
if (starts_with(var, "core."))
@@ -1,4 +1,5 @@
#include "cache.h"
+#include "config.h"
#include "string-list.h"
#include "mailmap.h"
#include "object-store.h"
@@ -12,8 +13,19 @@ static inline void debug_mm(const char *format, ...) {}
static inline const char *debug_str(const char *s) { return s; }
#endif
-const char *git_mailmap_file;
-const char *git_mailmap_blob;
+static const char *git_mailmap_file;
+static const char *git_mailmap_blob;
+
+int git_default_mailmap_config(const char *var, const char *value)
+{
+ if (!strcmp(var, "mailmap.file"))
+ return git_config_pathname(&git_mailmap_file, var, value);
+ if (!strcmp(var, "mailmap.blob"))
+ return git_config_string(&git_mailmap_blob, var, value);
+
+ /* Add other config variables here and to Documentation/config.txt. */
+ return 0;
+}
struct mailmap_info {
char *name;
@@ -3,6 +3,8 @@
struct string_list;
+int git_default_mailmap_config(const char *var, const char *value);
+
int read_mailmap(struct string_list *map);
void clear_mailmap(struct string_list *map);
This allows mailmap-specific variables to be tracked locally in `mailmap.c` instead of globally. Signed-off-by: Ben Boeckel <mathstuf@gmail.com> --- cache.h | 2 -- config.c | 12 +----------- mailmap.c | 16 ++++++++++++++-- mailmap.h | 2 ++ 4 files changed, 17 insertions(+), 15 deletions(-)