git-http-fetch: not a builtin
This splits up git-http-fetch so that it isn't built-in. It also removes the general dependency on curl, because it is no longer used by any built-in code. Because they are no longer LIB_OBJS, add LIB_H to the dependencies of http-related object files, and remove http.h from the dependencies of transport.o Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> Signed-off-by: Daniel Barkalow <barkalow@iabervon.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Linus Torvalds committed
Aug 5, 2009 at 01:01 UTC
1088261f6fc90324014b5306cca4171987da85ce
4 files changed
+11
-9
Makefile
+6
-4
@@ -980,10 +980,7 @@ else
980
else
981
CURL_LIBCURL = -lcurl
982
endif
983
- BUILTIN_OBJS += builtin-http-fetch.o
983
PROGRAMS += git-remote-http$X git-remote-https$X git-remote-ftp$X git-http-fetch$X
985
- EXTLIBS += $(CURL_LIBCURL)
986
- LIB_OBJS += http.o http-walker.o
984
curl_check := $(shell (echo 070908; curl-config --vernum) | sort -r | sed -ne 2p)
985
ifeq "$(curl_check)" "070908"
986
ifndef NO_EXPAT
@@ -1486,8 +1483,13 @@ git-imap-send$X: imap-send.o $(GITLIBS)
1483
$(QUIET_LINK)$(CC) $(ALL_CFLAGS) -o $@ $(ALL_LDFLAGS) $(filter %.o,$^) \
1484
$(LIBS) $(OPENSSL_LINK) $(OPENSSL_LIBSSL)
1485
1489
-http.o http-walker.o http-push.o transport.o: http.h
1486
+http.o http-walker.o http-push.o: http.h
1487
1488
+http.o http-walker.o: $(LIB_H)
1489
+
1490
+git-http-fetch$X: revision.o http.o http-push.o $(GITLIBS)
1491
+ $(QUIET_LINK)$(CC) $(ALL_CFLAGS) -o $@ $(ALL_LDFLAGS) $(filter %.o,$^) \
1492
+ $(LIBS) $(CURL_LIBCURL) $(EXPAT_LIBEXPAT)
1493
git-http-push$X: revision.o http.o http-push.o $(GITLIBS)
1494
$(QUIET_LINK)$(CC) $(ALL_CFLAGS) -o $@ $(ALL_LDFLAGS) $(filter %.o,$^) \
1495
$(LIBS) $(CURL_LIBCURL) $(EXPAT_LIBEXPAT)
git.c
-3
@@ -309,9 +309,6 @@ static void handle_internal_command(int argc, const char **argv)
309
{ "get-tar-commit-id", cmd_get_tar_commit_id },
310
{ "grep", cmd_grep, RUN_SETUP | USE_PAGER },
311
{ "help", cmd_help },
312
-#ifndef NO_CURL
313
- { "http-fetch", cmd_http_fetch, RUN_SETUP },
314
-#endif
312
{ "init", cmd_init_db },
313
{ "init-db", cmd_init_db },
314
{ "log", cmd_log, RUN_SETUP | USE_PAGER },
http-fetch.c
renamed
+4
-1
@@ -1,8 +1,9 @@
1
#include "cache.h"
2
#include "walker.h"
3
4
-int cmd_http_fetch(int argc, const char **argv, const char *prefix)
4
+int main(int argc, const char **argv)
5
{
6
+ const char *prefix;
7
struct walker *walker;
8
int commits_on_stdin = 0;
9
int commits;
@@ -18,6 +19,8 @@ int cmd_http_fetch(int argc, const char **argv, const char *prefix)
19
int get_verbosely = 0;
20
int get_recover = 0;
21
22
+ prefix = setup_git_directory();
23
+
24
git_config(git_default_config, NULL);
25
26
while (arg < argc && argv[arg][0] == '-') {
transport-helper.c
+1
-1
@@ -75,7 +75,7 @@ static int fetch_with_fetch(struct transport *transport,
75
struct strbuf buf = STRBUF_INIT;
76
77
for (i = 0; i < nr_heads; i++) {
78
- struct ref *posn = to_fetch[i];
78
+ const struct ref *posn = to_fetch[i];
79
if (posn->status & REF_STATUS_UPTODATE)
80
continue;
81
write_in_full(helper->in, "fetch ", 6);