fetch_refs_via_pack() discards status?
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Dec 5, 2007, 07:01 UTC
- Message-ID
- <7vk5nt1v7k.fsf@gitster.siamese.dyndns.org>
- In-Reply-To
- <7v3aunqvha.fsf_-_@gitster.siamese.dyndns.org>
The code calls fetch_pack() to get the list of refs it fetched, and discards refs and always returns 0 to signal success.
But builtin-fetch-pack.c::fetch_pack() has error cases. The function returns NULL if error is detected (shallow-support side seems to choose to die but I suspect that is easily fixable to error out as well).
Shouldn't fetch_refs_via_pack() propagate that error to the caller?
--- transport.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/transport.c b/transport.c index 50db980..048df1f 100644 --- a/transport.c +++ b/transport.c @@ -655,7 +655,7 @@ static int fetch_refs_via_pack(struct transport *transport, free(heads); free_refs(refs); free(dest); - return 0; + return (refs ? 0 : -1); } static int git_transport_push(struct transport *transport, int refspec_nr, const char **refspec, int flags)