Jonathan Nieder <jrnie...@gmail.com> writes:

> No functional change intended.
>
> Signed-off-by: Jonathan Nieder <jrnie...@gmail.com>
> ---
>  bundle.c |   57 +++++++++++++++++++++++++++++++--------------------------
>  1 files changed, 31 insertions(+), 26 deletions(-)
>
> diff --git a/bundle.c b/bundle.c
> index 0dd2acb..e90b5c5 100644
> --- a/bundle.c
> +++ b/bundle.c
> @@ -193,6 +193,33 @@ static int is_tag_in_date_range(struct object *tag, 
> struct rev_info *revs)
>               (revs->min_age == -1 || revs->min_age > date);
>  }
>  
> +static void list_prerequisite(int bundle_fd, struct rev_info *revs,
> +             struct commit *rev)
> +{
> +     struct strbuf buf = STRBUF_INIT;
> +     struct pretty_print_context ctx = {0};
> +     enum object_type type;
> +     unsigned long size;
> +
> +     /*
> +      * The commit buffer is needed
> +      * to pretty-print boundary commits.
> +      */
> +     rev->buffer = read_sha1_file(rev->object.sha1, &type, &size);
> +
> +     strbuf_addch(&buf, '-');
> +     strbuf_add(&buf, sha1_to_hex(rev->object.sha1), 40);
> +     strbuf_addch(&buf, ' ');
> +     pretty_print_commit(CMIT_FMT_ONELINE, rev, &buf, &ctx);
> +     strbuf_addch(&buf, '\n');
> +
> +     write_or_die(bundle_fd, buf.buf, buf.len);
> +
> +     rev->object.flags |= UNINTERESTING;
> +     add_pending_object(revs, &rev->object, buf.buf);
> +     strbuf_release(&buf);
> +}
> +
>  static int list_prerequisites(int bundle_fd, struct rev_info *revs,
>               int argc, const char * const *argv)
>  {
> @@ -209,33 +236,11 @@ static int list_prerequisites(int bundle_fd, struct 
> rev_info *revs,
>       if (prepare_revision_walk(&boundary_revs))
>               return error("revision walk setup failed");
>  
> -     while ((rev = get_revision(&boundary_revs))) {
> -             if (rev->object.flags & BOUNDARY) {
> -...
> -             } else {
> +     while ((rev = get_revision(revs))) {
> +             if (rev->object.flags & BOUNDARY)
> +                     list_prerequisite(bundle_fd, revs, rev);
> +             else
>                       rev->object.flags |= SHOWN;
> -             }

You used to walk boundary_revs but now you walk revs that is given by the
caller, exhausting the revs.pending the caller wanted to use later to feed
pack_objects with?

Confused...



-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org

Reply via email to