author | Junio C Hamano <gitster@pobox.com> | |
Thu, 13 Oct 2011 22:19:31 +0000 (15:19 -0700) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Thu, 13 Oct 2011 22:50:21 +0000 (15:50 -0700) | ||
commit | 2727b71f0547f5181653940d279854e7924788fb | |
tree | e8a94c1d0020cfcd05b1fc36565776f00d062374 | tree | snapshot |
parent | e9ee84cf28b6c7e5079ab3c020c86a44900a3f46 | commit | diff |
bundle: add parse_bundle_header() helper function
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>
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>
bundle.c | diff | blob | history | |
bundle.h | diff | blob | history | |
transport.c | diff | blob | history |