Re: [PATCH 07/26] upload-pack: use skip_prefix() instead of starts_with()
- From
Eric Sunshine <sunshine@sunshineco.com>
- Date
- May 25, 2016, 07:02 UTC
- Message-ID
- <CAPig+cTg-oTMiRBbcTpRdH5F8z=o_iQmndnCC-uZu6Sw93X+wA@mail.gmail.com>
- In-Reply-To
- <1460552110-5554-8-git-send-email-pclouds@gmail.com>
On Wed, Apr 13, 2016 at 8:54 AM, Nguyễn Thái Ngọc Duy <pclouds@gmail.com> wrote:
Show 10 quoted lines
> upload-pack: use skip_prefix() instead of starts_with()
>
> Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
> ---
> 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?