Nguyễn Thái Ngọc Duy  <[email protected]> writes:

> +static void deepen(int depth, const struct object_array *shallows)
> +{
> +     struct commit_list *result = NULL;
> +     int i;
> +     if (depth == INFINITE_DEPTH && !is_repository_shallow())
> +             for (i = 0; i < shallows->nr; i++) {
> +                     struct object *object = shallows->objects[i].item;
> +                     object->flags |= NOT_SHALLOW;
> +             }
> +     else
> +             result = get_shallow_commits(&want_obj, depth,
> +                                          SHALLOW, NOT_SHALLOW);
> +     send_shallow(result);
> +     free_commit_list(result);
> +     send_unshallow(shallows);
>       packet_flush(1);
>  }

Starting from the original up to this point, the code structure of
this function have bothered me quite a bit because I would expect

        if (depth == INFINITE_DEPTH && !is_repository_shallow()) {
                for (i = 0; i < shallows->nr; i++) {
                        struct object *object = shallows->objects[i].item;
                        object->flags |= NOT_SHALLOW;
                }
        } else {
                struct commit_list *result;
                result = get_shallow_commits(&want_obj, depth,
                                             SHALLOW, NOT_SHALLOW);
                send_shallow(result);
                free_commit_list(result);
        }
        send_unshallow(shallows);
        packet_flush(1);

would be easier to understand.  The function seems to be reshaped
further in the series, so let's keep reading...
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to