summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: ad17f01)
raw | patch | inline | side by side (parent: ad17f01)
author | Daniel Barkalow <barkalow@iabervon.org> | |
Fri, 4 Sep 2009 02:13:49 +0000 (22:13 -0400) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Fri, 4 Sep 2009 04:27:36 +0000 (21:27 -0700) |
Instead of trying to make http://, https://, and ftp:// URLs
indicative of some sort of pattern of transport helper usage, make
them a special case which runs the "curl" helper, and leave the
mechanism by which arbitrary helpers will be chosen entirely to future
work.
Signed-off-by: Daniel Barkalow <barkalow@iabervon.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
indicative of some sort of pattern of transport helper usage, make
them a special case which runs the "curl" helper, and leave the
mechanism by which arbitrary helpers will be chosen entirely to future
work.
Signed-off-by: Daniel Barkalow <barkalow@iabervon.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Makefile | patch | blob | history | |
transport-helper.c | patch | blob | history | |
transport.c | patch | blob | history | |
transport.h | patch | blob | history |
diff --git a/Makefile b/Makefile
index 438cffb44260cb5bd6265992b6833336c4e27bdc..8c44e357c861b93763eb517286c439392169315a 100644 (file)
--- a/Makefile
+++ b/Makefile
else
CURL_LIBCURL = -lcurl
endif
- CURL_SYNONYMS = git-remote-https$X git-remote-ftp$X
- PROGRAMS += git-remote-http$X $(CURL_SYNONYMS) git-http-fetch$X
+ PROGRAMS += git-remote-curl$X git-http-fetch$X
curl_check := $(shell (echo 070908; curl-config --vernum) | sort -r | sed -ne 2p)
ifeq "$(curl_check)" "070908"
ifndef NO_EXPAT
$(QUIET_LINK)$(CC) $(ALL_CFLAGS) -o $@ $(ALL_LDFLAGS) $(filter %.o,$^) \
$(LIBS) $(CURL_LIBCURL) $(EXPAT_LIBEXPAT)
-git-remote-http$X: remote-curl.o http.o http-walker.o $(GITLIBS)
+git-remote-curl$X: remote-curl.o http.o http-walker.o $(GITLIBS)
$(QUIET_LINK)$(CC) $(ALL_CFLAGS) -o $@ $(ALL_LDFLAGS) $(filter %.o,$^) \
$(LIBS) $(CURL_LIBCURL) $(EXPAT_LIBEXPAT)
-$(CURL_SYNONYMS): git-remote-http$X
- $(QUIET_LNCP)$(RM) $@ && \
- ln $< $@ 2>/dev/null || \
- ln -s $< $@ 2>/dev/null || \
- cp $< $@
-
$(LIB_OBJS) $(BUILTIN_OBJS): $(LIB_H)
$(patsubst git-%$X,%.o,$(PROGRAMS)) git.o: $(LIB_H) $(wildcard */*.h)
builtin-revert.o wt-status.o: wt-status.h
ln -s "git$X" "$$execdir/$$p" 2>/dev/null || \
cp "$$execdir/git$X" "$$execdir/$$p" || exit; \
done; } && \
- { for p in $(CURL_SYNONYMS); do \
- $(RM) "$$execdir/$$p" && \
- ln "$$execdir/git-remote-http$X" "$$execdir/$$p" 2>/dev/null || \
- ln -s "git-remote-http$X" "$$execdir/$$p" 2>/dev/null || \
- cp "$$execdir/git-remote-http$X" "$$execdir/$$p" || exit; \
- done; } && \
./check_bindir "z$$bindir" "z$$execdir" "$$bindir/git-add$X"
install-doc:
diff --git a/transport-helper.c b/transport-helper.c
index 43fdc0a434caf65f9ecc988ad8a3ab17229f60c2..46848777233c31b12897cf06ecf71e1718b342c1 100644 (file)
--- a/transport-helper.c
+++ b/transport-helper.c
return ret;
}
-int transport_helper_init(struct transport *transport)
+int transport_helper_init(struct transport *transport, const char *name)
{
struct helper_data *data = xcalloc(sizeof(*data), 1);
- char *eom = strchr(transport->url, ':');
- if (!eom)
- return -1;
- data->name = xstrndup(transport->url, eom - transport->url);
+ data->name = name;
transport->data = data;
transport->get_refs_list = get_refs_list;
diff --git a/transport.c b/transport.c
index 9935c85cf337ef7e99bee38c8e49684df8dd6b3a..b654d71d5af07ced257908fc8aa12cd83c947011 100644 (file)
--- a/transport.c
+++ b/transport.c
} else if (!prefixcmp(url, "http://")
|| !prefixcmp(url, "https://")
|| !prefixcmp(url, "ftp://")) {
- transport_helper_init(ret);
+ transport_helper_init(ret, "curl");
#ifdef NO_CURL
error("git was compiled without libcurl support.");
#else
diff --git a/transport.h b/transport.h
index df87264637bcc6fc5954b52a9580f4d222ac3a00..b49c10f57db86796a3c336c8b715d71fa49fdf0e 100644 (file)
--- a/transport.h
+++ b/transport.h
char *transport_anonymize_url(const char *url);
/* Transport methods defined outside transport.c */
-int transport_helper_init(struct transport *transport);
+int transport_helper_init(struct transport *transport, const char *name);
#endif