Re: [PATCH 07/26] upload-pack: use skip_prefix() instead of starts_with()

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

 



On Wed, Apr 13, 2016 at 8:54 AM, Nguyễn Thái Ngọc Duy <pclouds@xxxxxxxxx> wrote:
> upload-pack: use skip_prefix() instead of starts_with()
>
> Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@xxxxxxxxx>
> ---
> diff --git a/upload-pack.c b/upload-pack.c
> @@ -403,8 +405,8 @@ static int get_common_commits(void)
> -               if (starts_with(line, "have ")) {
> -                       switch (got_sha1(line+5, sha1)) {
> +               if (skip_prefix(line, "have ", &arg)) {
> +                       switch (got_sha1(arg, sha1)) {

There's one more instance of starts_with() in upload-pack.c:main()
which could be given the same treatment:

    if (starts_with(arg, "--timeout=")) {
        timeout = atoi(arg+10);
        daemon_mode = 1;
        continue;
    }

Was its omission an oversight or intentional since it's not related to
the others?
--
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]