summaryrefslogtreecommitdiff
path: root/src/oid.c
diff options
context:
space:
mode:
authorEdward Thomson <ethomson@edwardthomson.com>2020-05-14 10:36:35 +0100
committerEdward Thomson <ethomson@edwardthomson.com>2020-10-11 20:06:15 +0100
commit4853d94ca47a6f1ecaa7c24b9034ededcb7e5bff (patch)
tree8c188e634e95762246ddcb4775aee7efae4fad27 /src/oid.c
parentbc3919abc716088cf7c33bc08d48ee2bc434c398 (diff)
downloadlibgit2-4853d94ca47a6f1ecaa7c24b9034ededcb7e5bff.tar.gz
global: separate global state from thread-local state
Our "global initialization" has accumulated some debris over the years. It was previously responsible for both running the various global initializers (that set up various subsystems) _and_ setting up the "global state", which is actually the thread-local state for things like error reporting. Separate the thread local state out into "threadstate". Use the normal subsystem initialization functions that we already have to set it up. This makes both the global initialization system and the threadstate system simpler to reason about.
Diffstat (limited to 'src/oid.c')
-rw-r--r--src/oid.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/oid.c b/src/oid.c
index 7831aca89..a8ad3d2ee 100644
--- a/src/oid.c
+++ b/src/oid.c
@@ -9,7 +9,7 @@
#include "git2/oid.h"
#include "repository.h"
-#include "global.h"
+#include "threadstate.h"
#include <string.h>
#include <limits.h>
@@ -107,7 +107,7 @@ int git_oid_pathfmt(char *str, const git_oid *oid)
char *git_oid_tostr_s(const git_oid *oid)
{
- char *str = GIT_GLOBAL->oid_fmt;
+ char *str = GIT_THREADSTATE->oid_fmt;
git_oid_nfmt(str, GIT_OID_HEXSZ + 1, oid);
return str;
}