summaryrefslogtreecommitdiff
path: root/version.c
diff options
context:
space:
mode:
Diffstat (limited to 'version.c')
-rw-r--r--version.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/version.c b/version.c
index ca68653865..f98d5a654d 100644
--- a/version.c
+++ b/version.c
@@ -2,3 +2,16 @@
#include "version.h"
const char git_version_string[] = GIT_VERSION;
+
+const char *git_user_agent(void)
+{
+ static const char *agent = NULL;
+
+ if (!agent) {
+ agent = getenv("GIT_USER_AGENT");
+ if (!agent)
+ agent = GIT_USER_AGENT;
+ }
+
+ return agent;
+}