diff options
author | Junio C Hamano <gitster@pobox.com> | 2017-09-28 14:47:53 +0900 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2017-09-28 14:47:53 +0900 |
commit | 59373a4e03e273841c6c3b7fc9ac29c0a3e90c6d (patch) | |
tree | 68bf3a94d919657469c3fdb7ad2204761571c9bf /builtin | |
parent | Merge branch 'jk/diff-blob' (diff) | |
parent | consistently use "fallthrough" comments in switches (diff) | |
download | tgif-59373a4e03e273841c6c3b7fc9ac29c0a3e90c6d.tar.xz |
Merge branch 'jk/fallthrough'
Many codepaths have been updated to squelch -Wimplicit-fallthrough
warnings from Gcc 7 (which is a good code hygiene).
* jk/fallthrough:
consistently use "fallthrough" comments in switches
curl_trace(): eliminate switch fallthrough
test-line-buffer: simplify command parsing
Diffstat (limited to 'builtin')
-rw-r--r-- | builtin/cat-file.c | 1 | ||||
-rw-r--r-- | builtin/checkout.c | 1 | ||||
-rw-r--r-- | builtin/remote-ext.c | 2 | ||||
-rw-r--r-- | builtin/submodule--helper.c | 1 |
4 files changed, 4 insertions, 1 deletions
diff --git a/builtin/cat-file.c b/builtin/cat-file.c index 1ea25331d3..f5fa4fd75a 100644 --- a/builtin/cat-file.c +++ b/builtin/cat-file.c @@ -113,6 +113,7 @@ static int cat_one_file(int opt, const char *exp_type, const char *obj_name, if (textconv_object(path, obj_context.mode, &oid, 1, &buf, &size)) break; + /* else fallthrough */ case 'p': type = sha1_object_info(oid.hash, NULL); diff --git a/builtin/checkout.c b/builtin/checkout.c index 5c202b7af5..d091f06274 100644 --- a/builtin/checkout.c +++ b/builtin/checkout.c @@ -436,6 +436,7 @@ static int reset_tree(struct tree *tree, const struct checkout_opts *o, * update paths in the work tree, and we cannot revert * them. */ + /* fallthrough */ case 0: return 0; default: diff --git a/builtin/remote-ext.c b/builtin/remote-ext.c index bfb21ba7d2..6a9127a33c 100644 --- a/builtin/remote-ext.c +++ b/builtin/remote-ext.c @@ -57,7 +57,7 @@ static char *strip_escapes(const char *str, const char *service, special = str[rpos]; if (rpos == 1) break; - /* Fall-through to error. */ + /* fallthrough */ default: die("Bad remote-ext placeholder '%%%c'.", str[rpos]); diff --git a/builtin/submodule--helper.c b/builtin/submodule--helper.c index 818fe74f0a..f6a5e1af5d 100644 --- a/builtin/submodule--helper.c +++ b/builtin/submodule--helper.c @@ -1189,6 +1189,7 @@ static int push_check(int argc, const char **argv, const char *prefix) break; die("HEAD does not match the named branch in the superproject"); } + /* fallthrough */ default: die("src refspec '%s' must name a ref", rs->src); |