Re: [PATCH 2/2] bisect--helper: `check_expected_revs` shell function in C

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Jun 8, 2016 at 11:24 AM, Pranit Bauva <pranit.bauva@xxxxxxxxx> wrote:
> Reimplement the `check_expected_revs` shell function in C and add a
> `--check-expected-revs` subcommand to `git bisect--helper` to call it
> from git-bisect.sh .
> [...]
> Signed-off-by: Pranit Bauva <pranit.bauva@xxxxxxxxx>
> ---
> diff --git a/builtin/bisect--helper.c b/builtin/bisect--helper.c
> index 06bc9b8..500efd5 100644
> @@ -174,13 +174,28 @@ static int is_expected_rev(const char *expected_hex)
> +static int check_expected_revs(const char **revs, int no)

In this codebase, it's more common to name this 'nr' rather than 'no'.
'revs_nr' would also be a good name.

> +{
> +       int i;
> +
> +       for (i = 0; i < no; i++) {
> +               if (!is_expected_rev(revs[i])) {
> +                       remove_path(git_path_bisect_ancestors_ok());
> +                       remove_path(git_path_bisect_expected_rev());
> +                       return 0;
> +               }
> +       }
> +       return 0;
> +}
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]