Skip to content

Commit 1088261

Browse files
torvaldsgitster
authored andcommitted
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 <[email protected]> Signed-off-by: Daniel Barkalow <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent a2d725b commit 1088261

File tree

4 files changed

+11
-9
lines changed

4 files changed

+11
-9
lines changed

Makefile

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -980,10 +980,7 @@ else
980980
else
981981
CURL_LIBCURL = -lcurl
982982
endif
983-
BUILTIN_OBJS += builtin-http-fetch.o
984983
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
987984
curl_check := $(shell (echo 070908; curl-config --vernum) | sort -r | sed -ne 2p)
988985
ifeq "$(curl_check)" "070908"
989986
ifndef NO_EXPAT
@@ -1486,8 +1483,13 @@ git-imap-send$X: imap-send.o $(GITLIBS)
14861483
$(QUIET_LINK)$(CC) $(ALL_CFLAGS) -o $@ $(ALL_LDFLAGS) $(filter %.o,$^) \
14871484
$(LIBS) $(OPENSSL_LINK) $(OPENSSL_LIBSSL)
14881485

1489-
http.o http-walker.o http-push.o transport.o: http.h
1486+
http.o http-walker.o http-push.o: http.h
14901487

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)
14911493
git-http-push$X: revision.o http.o http-push.o $(GITLIBS)
14921494
$(QUIET_LINK)$(CC) $(ALL_CFLAGS) -o $@ $(ALL_LDFLAGS) $(filter %.o,$^) \
14931495
$(LIBS) $(CURL_LIBCURL) $(EXPAT_LIBEXPAT)

git.c

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -309,9 +309,6 @@ static void handle_internal_command(int argc, const char **argv)
309309
{ "get-tar-commit-id", cmd_get_tar_commit_id },
310310
{ "grep", cmd_grep, RUN_SETUP | USE_PAGER },
311311
{ "help", cmd_help },
312-
#ifndef NO_CURL
313-
{ "http-fetch", cmd_http_fetch, RUN_SETUP },
314-
#endif
315312
{ "init", cmd_init_db },
316313
{ "init-db", cmd_init_db },
317314
{ "log", cmd_log, RUN_SETUP | USE_PAGER },

builtin-http-fetch.c renamed to http-fetch.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
#include "cache.h"
22
#include "walker.h"
33

4-
int cmd_http_fetch(int argc, const char **argv, const char *prefix)
4+
int main(int argc, const char **argv)
55
{
6+
const char *prefix;
67
struct walker *walker;
78
int commits_on_stdin = 0;
89
int commits;
@@ -18,6 +19,8 @@ int cmd_http_fetch(int argc, const char **argv, const char *prefix)
1819
int get_verbosely = 0;
1920
int get_recover = 0;
2021

22+
prefix = setup_git_directory();
23+
2124
git_config(git_default_config, NULL);
2225

2326
while (arg < argc && argv[arg][0] == '-') {

transport-helper.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ static int fetch_with_fetch(struct transport *transport,
7575
struct strbuf buf = STRBUF_INIT;
7676

7777
for (i = 0; i < nr_heads; i++) {
78-
struct ref *posn = to_fetch[i];
78+
const struct ref *posn = to_fetch[i];
7979
if (posn->status & REF_STATUS_UPTODATE)
8080
continue;
8181
write_in_full(helper->in, "fetch ", 6);

0 commit comments

Comments
 (0)