From: Derrick Stolee via GitGitGadget Date: Fri, 09 Sep 2022 14:33:27 GMT Subject: [PATCH v2 1/9] bundle-uri: short-circuit capability parsing Message-ID: <2ca431e6c377f42d70ea9ce0ac74058fc983ea2c.1662734015.git.gitgitgadget@gmail.com> In-Reply-To: From: Derrick Stolee When parsing the capability lines from the 'git remote-https' process, we can stop reading the lines once we notice the 'get' capability. Reported-by: Teng Long Signed-off-by: Derrick Stolee --- bundle-uri.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/bundle-uri.c b/bundle-uri.c index 4a8cc74ed05..7173ed065e9 100644 --- a/bundle-uri.c +++ b/bundle-uri.c @@ -56,8 +56,10 @@ static int download_https_uri_to_file(const char *file, const char *uri) while (!strbuf_getline(&line, child_out)) { if (!line.len) break; - if (!strcmp(line.buf, "get")) + if (!strcmp(line.buf, "get")) { found_get = 1; + break; + } } strbuf_release(&line); -- gitgitgadget