[PATCH 07/17] Pass nr_heads to do_pack_ref() by reference
- From
mhagger@alum.mit.edu <mhagger@alum.mit.edu>
- Date
- Aug 23, 2012, 08:10 UTC
- Message-ID
- <1345709442-16046-8-git-send-email-mhagger@alum.mit.edu>
- In-Reply-To
- <1345709442-16046-1-git-send-email-mhagger@alum.mit.edu>
From: Michael Haggerty <mhagger@alum.mit.edu>
This is the first of a few baby steps towards changing filter_refs() to compress matched refs out of the list rather than overwriting the first character of such references with '\0'.
Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu> --- 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 3c93ec4..d3ff166 100644 --- a/builtin/fetch-pack.c +++ b/builtin/fetch-pack.c @@ -777,7 +777,7 @@ static int get_pack(int xd[2], char **pack_lockfile) static struct ref *do_fetch_pack(int fd[2], const struct ref *orig_ref, - int nr_heads, char **heads, + int *nr_heads, char **heads, char **pack_lockfile) { struct ref *ref = copy_ref_list(orig_ref); @@ -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; } @@ -1086,7 +1086,7 @@ struct ref *fetch_pack(struct fetch_pack_args *my_args, packet_flush(fd[1]); die("no matching remote head"); } - ref_cpy = do_fetch_pack(fd, ref, *nr_heads, heads, pack_lockfile); + ref_cpy = do_fetch_pack(fd, ref, nr_heads, heads, pack_lockfile); if (args.depth > 0) { struct cache_time mtime;
-- 1.7.11.3