Skip to contentSkip to conversation

merge-recursive: remove superfluous semicolon

PATCH In review Elijah Newren 2 participants 3 messages Sep 5, 2018

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 merge-recursive: remove superfluous semicolon

---
Once I saw it, I couldn't unsee it, and it quickly started getting on my nerves... My bad for not noticing it when reviewing the original patch that introduced it, I guess -- 9da2d0379ea0 ("merge-recursive: use xstrdup() instead of fixed buffer", 2018-06-10)

 merge-recursive.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
merge-recursive.c +1 -1
index e5243dbc54..1b5c255918 100644
@@ -2239,7 +2239,7 @@ static struct dir_rename_entry *check_dir_renamed(const char *path,
 {
 	char *temp = xstrdup(path);
 	char *end;
-	struct dir_rename_entry *entry = NULL;;
+	struct dir_rename_entry *entry = NULL;
 
 	while ((end = strrchr(temp, '/'))) {
 		*end = '\0';
Signature · 1 line
2.19.0.rc2.1.g7fc77f67e1
#1 lore raw
Quoted 5 lines · Elijah Newren

---
Once I saw it, I couldn't unsee it, and it quickly started getting on my nerves...

Bad Elijah! Should have grepped and fixed all three ;-)

$ git grep ';;$' -- '*.c'
builtin/receive-pack.c: hmac_sha1(sha1, buf.buf, buf.len,
cert_nonce_seed, strlen(cert_nonce_seed));;
merge-recursive.c:      struct dir_rename_entry *entry = NULL;;
remote-curl.c:          options.filter = xstrdup(value);;
Quoted 20 lines
 merge-recursive.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
merge-recursive.c +1 -2
index e5243dbc54..1b5c255918 100644
@@ -2239,7 +2239,7 @@ static struct dir_rename_entry *check_dir_renamed(const char *path,
 {
        char *temp = xstrdup(path);
        char *end;
-       struct dir_rename_entry *entry = NULL;;
+       struct dir_rename_entry *entry = NULL;
 
        while ((end = strrchr(temp, '/'))) {
                *end = '\0';
--

2.19.0.rc2.1.g7fc77f67e1

Signature · 1 line
Duy
#2 lore raw
Quoted 8 lines · Duy Nguyen
Quoted 5 lines · Elijah Newren

---
Once I saw it, I couldn't unsee it, and it quickly started getting on my nerves...

Quoted 7 lines

Bad Elijah! Should have grepped and fixed all three ;-)

$ git grep ';;$' -- '*.c'
builtin/receive-pack.c: hmac_sha1(sha1, buf.buf, buf.len,
cert_nonce_seed, strlen(cert_nonce_seed));;
merge-recursive.c:      struct dir_rename_entry *entry = NULL;;
remote-curl.c:          options.filter = xstrdup(value);;

Whoops, indeed. I didn't think about the fact that the same problem might appear in some other file. Anyway, here's the extended fix.

-- 8< --
Subject: [PATCH] Remove superfluous trailing semicolons

---
 builtin/receive-pack.c | 2 +-
 merge-recursive.c      | 2 +-
 remote-curl.c          | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)
builtin/receive-pack.c +1 -1
index c17ce94e12..a8423a940f 100644
@@ -465,7 +465,7 @@ static char *prepare_push_cert_nonce(const char *path, timestamp_t stamp)
 	unsigned char sha1[GIT_SHA1_RAWSZ];
 
 	strbuf_addf(&buf, "%s:%"PRItime, path, stamp);
-	hmac_sha1(sha1, buf.buf, buf.len, cert_nonce_seed, strlen(cert_nonce_seed));;
+	hmac_sha1(sha1, buf.buf, buf.len, cert_nonce_seed, strlen(cert_nonce_seed));
 	strbuf_release(&buf);
 
 	/* RFC 2104 5. HMAC-SHA1-80 */
merge-recursive.c +1 -1
index e5243dbc54..1b5c255918 100644
@@ -2239,7 +2239,7 @@ static struct dir_rename_entry *check_dir_renamed(const char *path,
 {
 	char *temp = xstrdup(path);
 	char *end;
-	struct dir_rename_entry *entry = NULL;;
+	struct dir_rename_entry *entry = NULL;
 
 	while ((end = strrchr(temp, '/'))) {
 		*end = '\0';
remote-curl.c +1 -1
index fb28309e85..762a55a75f 100644
@@ -178,7 +178,7 @@ static int set_option(const char *name, const char *value)
 		options.no_dependents = 1;
 		return 0;
 	} else if (!strcmp(name, "filter")) {
-		options.filter = xstrdup(value);;
+		options.filter = xstrdup(value);
 		return 0;
 	} else {
 		return 1 /* unsupported */;
Signature · 1 line
2.19.0.rc2.2.g1aedc61e22