Skip to content

Commit

Permalink
do not discard status in fetch_refs_via_pack()
Browse files Browse the repository at this point in the history
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).

Make fetch_refs_via_pack() propagate that error to the caller.

Acked-By: Daniel Barkalow <barkalow@iabervon.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
  • Loading branch information
gitster committed Dec 6, 2007
1 parent c9ecf4f commit c6bc400
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion transport.c
Expand Up @@ -659,7 +659,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)
Expand Down

0 comments on commit c6bc400

Please sign in to comment.