summaryrefslogtreecommitdiff
path: root/transport.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2011-10-13 15:19:31 -0700
committerJunio C Hamano <gitster@pobox.com>2011-10-13 15:50:21 -0700
commit2727b71f0547f5181653940d279854e7924788fb (patch)
treee8a94c1d0020cfcd05b1fc36565776f00d062374 /transport.c
parente9ee84cf28b6c7e5079ab3c020c86a44900a3f46 (diff)
downloadgit-2727b71f0547f5181653940d279854e7924788fb.tar.gz
bundle: add parse_bundle_header() helper functionjc/unseekable-bundle
Move most of the code from read_bundle_header() to parse_bundle_header() that takes a file descriptor that is already opened for reading, and make the former responsible only for opening the file and noticing errors. As a logical consequence of this, is_bundle() helper function can be implemented as a non-complaining variant of read_bundle_header() that does not return an open file descriptor, and can be used to tighten the check used to decide the use of bundle transport in transport_get() function. Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'transport.c')
-rw-r--r--transport.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/transport.c b/transport.c
index c9c8056f9d..84d6480ce6 100644
--- a/transport.c
+++ b/transport.c
@@ -913,7 +913,7 @@ struct transport *transport_get(struct remote *remote, const char *url)
ret->fetch = fetch_objs_via_rsync;
ret->push = rsync_transport_push;
ret->smart_options = NULL;
- } else if (is_local(url) && is_file(url)) {
+ } else if (is_local(url) && is_file(url) && is_bundle(url, 1)) {
struct bundle_transport_data *data = xcalloc(1, sizeof(*data));
ret->data = data;
ret->get_refs_list = get_refs_from_bundle;