Skip to content

Commit 745c7c8

Browse files
peffgitster
authored andcommitted
http: get default user-agent from git_user_agent
This means we will respect the GIT_USER_AGENT build-time configuration and run-time environment variable. Signed-off-by: Jeff King <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 42dcbb7 commit 745c7c8

File tree

2 files changed

+3
-5
lines changed

2 files changed

+3
-5
lines changed

Makefile

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2104,7 +2104,7 @@ configure: configure.ac
21042104
$(RM) $<+
21052105

21062106
# These can record GIT_VERSION
2107-
version.o git.spec http.o \
2107+
version.o git.spec \
21082108
$(patsubst %.sh,%,$(SCRIPT_SH)) \
21092109
$(patsubst %.perl,%,$(SCRIPT_PERL)) \
21102110
: GIT-VERSION-FILE
@@ -2274,9 +2274,6 @@ attr.sp attr.s attr.o: EXTRA_CPPFLAGS = \
22742274
gettext.sp gettext.s gettext.o: EXTRA_CPPFLAGS = \
22752275
-DGIT_LOCALE_PATH='"$(localedir_SQ)"'
22762276

2277-
http.sp http.s http.o: EXTRA_CPPFLAGS = \
2278-
-DGIT_HTTP_USER_AGENT='"git/$(GIT_VERSION)"'
2279-
22802277
ifdef NO_EXPAT
22812278
http-walker.sp http-walker.s http-walker.o: EXTRA_CPPFLAGS = -DNO_EXPAT
22822279
endif

http.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
#include "run-command.h"
55
#include "url.h"
66
#include "credential.h"
7+
#include "version.h"
78

89
int active_requests;
910
int http_is_verbose;
@@ -299,7 +300,7 @@ static CURL *get_curl_handle(void)
299300
curl_easy_setopt(result, CURLOPT_VERBOSE, 1);
300301

301302
curl_easy_setopt(result, CURLOPT_USERAGENT,
302-
user_agent ? user_agent : GIT_HTTP_USER_AGENT);
303+
user_agent ? user_agent : git_user_agent());
303304

304305
if (curl_ftp_no_epsv)
305306
curl_easy_setopt(result, CURLOPT_FTP_USE_EPSV, 0);

0 commit comments

Comments
 (0)