summaryrefslogtreecommitdiff
path: root/src/git
diff options
context:
space:
mode:
Diffstat (limited to 'src/git')
-rw-r--r--src/git/errors.h25
-rw-r--r--src/git/thread-utils.h7
2 files changed, 32 insertions, 0 deletions
diff --git a/src/git/errors.h b/src/git/errors.h
new file mode 100644
index 000000000..d0a0d6308
--- /dev/null
+++ b/src/git/errors.h
@@ -0,0 +1,25 @@
+#ifndef INCLUDE_git_errors_h__
+#define INCLUDE_git_errors_h__
+/**
+ * @file git/errors.h
+ * @brief Git error handling routines and variables
+ * @ingroup Git
+ * @{
+ */
+
+#include "common.h"
+#include "thread-utils.h"
+GIT_BEGIN_DECL
+
+/** The git errno. */
+GIT_EXTERN(int) GIT_TLS git_errno;
+
+/**
+ * strerror() for the Git library
+ * @param num The error code to explain
+ * @return a string explaining the error code
+ */
+GIT_EXTERN(const char *) git_strerror(int num);
+/** @} */
+GIT_END_DECL
+#endif
diff --git a/src/git/thread-utils.h b/src/git/thread-utils.h
index f2ddf1eec..7ce66fdc1 100644
--- a/src/git/thread-utils.h
+++ b/src/git/thread-utils.h
@@ -22,4 +22,11 @@
# define GIT_TLS /* nothing: tls vars are thread-global */
#endif
+/* sparse doesn't grok thread-local variables */
+#ifdef SPARSE_IS_RUNNING
+# undef GIT_HAS_TLS
+# undef GIT_TLS
+# define GIT_TLS
+#endif
+
#endif /* INCLUDE_git_thread_utils_h__ */