From: mhagger@alum.mit.edu Date: Thu, 23 Aug 2012 08:10:33 GMT Subject: [PATCH 08/17] Pass nr_heads to everything_local() by reference Message-ID: <1345709442-16046-9-git-send-email-mhagger@alum.mit.edu> In-Reply-To: <1345709442-16046-1-git-send-email-mhagger@alum.mit.edu> From: Michael Haggerty Signed-off-by: Michael Haggerty --- builtin/fetch-pack.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/builtin/fetch-pack.c b/builtin/fetch-pack.c index d3ff166..5905dae 100644 --- a/builtin/fetch-pack.c +++ b/builtin/fetch-pack.c @@ -595,7 +595,7 @@ static void mark_alternate_complete(const struct ref *ref, void *unused) mark_complete(NULL, ref->old_sha1, 0, NULL); } -static int everything_local(struct ref **refs, int nr_heads, char **heads) +static int everything_local(struct ref **refs, int *nr_heads, char **heads) { struct ref *ref; int retval; @@ -646,7 +646,7 @@ static int everything_local(struct ref **refs, int nr_heads, char **heads) } } - filter_refs(refs, nr_heads, heads); + filter_refs(refs, *nr_heads, heads); for (retval = 1, ref = *refs; ref ; ref = ref->next) { const unsigned char *remote = ref->old_sha1; @@ -818,7 +818,7 @@ static struct ref *do_fetch_pack(int fd[2], fprintf(stderr, "Server supports ofs-delta\n"); } else prefer_ofs_delta = 0; - if (everything_local(&ref, *nr_heads, heads)) { + if (everything_local(&ref, nr_heads, heads)) { packet_flush(fd[1]); goto all_done; } -- 1.7.11.3