]> git.ipfire.org Git - thirdparty/git.git/commitdiff
remote-curl: avoid using the comma operator unnecessarily
authorJohannes Schindelin <johannes.schindelin@gmx.de>
Thu, 27 Mar 2025 11:52:54 +0000 (11:52 +0000)
committerJunio C Hamano <gitster@pobox.com>
Sat, 29 Mar 2025 00:38:08 +0000 (17:38 -0700)
The comma operator is a somewhat obscure C feature that is often used by
mistake and can even cause unintentional code flow. Better use a
semicolon instead.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Acked-by: Phillip Wood <phillip.wood@dunelm.org.uk>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
remote-curl.c

index 1273507a96cae97eeaac9a95a47618e5e4f72850..590b228f67fcbc2872e24bba5aad8fc68adc1fc0 100644 (file)
@@ -1239,7 +1239,7 @@ static int fetch_git(struct discovery *heads,
        packet_buf_flush(&preamble);
 
        memset(&rpc, 0, sizeof(rpc));
-       rpc.service_name = "git-upload-pack",
+       rpc.service_name = "git-upload-pack";
        rpc.gzip_request = 1;
 
        err = rpc_service(&rpc, heads, args.v, &preamble, &rpc_result);
@@ -1401,7 +1401,7 @@ static int push_git(struct discovery *heads, int nr_spec, const char **specs)
        packet_buf_flush(&preamble);
 
        memset(&rpc, 0, sizeof(rpc));
-       rpc.service_name = "git-receive-pack",
+       rpc.service_name = "git-receive-pack";
 
        err = rpc_service(&rpc, heads, args.v, &preamble, &rpc_result);
        if (rpc_result.len)