Merge branch 'cn/cherry-pick-range-docs'
[gitweb.git] / version.c
index ca686538652300f26cd838ea40110480200f4c12..f98d5a654d4a17a9d85157b33f161afe6951a6e8 100644 (file)
--- 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;
+}