Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorÆvar Arnfjörð Bjarmason <avarab@gmail.com>2020-12-16 02:50:27 +0300
committerJunio C Hamano <gitster@pobox.com>2020-12-16 03:32:50 +0300
commit56f56ac50b932310c629832fad256e624ca451e3 (patch)
tree021707d7d8db0ffeb116c291298594d15d6c01ff /builtin/fast-export.c
parent898f80736c75878acc02dc55672317fcc0e0a5a6 (diff)
style: do not "break" in switch() after "return"
Remove this unreachable code. It was found by SunCC, it's found by a non-fatal warning emitted by SunCC. It's one of the things it's more vehement about than GCC & Clang. It complains about a lot of other similarly unreachable code, e.g. a BUG(...) without a "return", and a "return 0" after a long if/else, both of whom have "return" statements. Those are also genuine redundancies to a compiler, but arguably make the code a bit easier to read & less fragile to maintain. These return/break cases are just unnecessary however, and as seen here the surrounding code just did a plain "return" without a "break" already. Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin/fast-export.c')
-rw-r--r--builtin/fast-export.c1
1 files changed, 0 insertions, 1 deletions
diff --git a/builtin/fast-export.c b/builtin/fast-export.c
index d2e33f5005..0a60356b06 100644
--- a/builtin/fast-export.c
+++ b/builtin/fast-export.c
@@ -923,7 +923,6 @@ static struct commit *get_commit(struct rev_cmdline_entry *e, char *full_name)
if (!tag)
die("Tag %s points nowhere?", e->name);
return (struct commit *)tag;
- break;
}
default:
return NULL;