help: make help_unknown_ref() NORETURN
authorRené Scharfe <l.s.r@web.de>
Thu, 29 Aug 2019 19:13:16 +0000 (21:13 +0200)
committerJunio C Hamano <gitster@pobox.com>
Fri, 30 Aug 2019 17:22:42 +0000 (10:22 -0700)
Announce that calling help_unknown_ref() exits the program.

Signed-off-by: René Scharfe <l.s.r@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
help.c
help.h
diff --git a/help.c b/help.c
index a9e451f2ee7a165eecb17746db9cc1a2f7e2cfbb..5231c919c70bb4be553dd03a25e1066a1e4aa925 100644 (file)
--- a/help.c
+++ b/help.c
@@ -774,7 +774,8 @@ static struct string_list guess_refs(const char *ref)
        return similar_refs;
 }
 
-void help_unknown_ref(const char *ref, const char *cmd, const char *error)
+NORETURN void help_unknown_ref(const char *ref, const char *cmd,
+                              const char *error)
 {
        int i;
        struct string_list suggested_refs = guess_refs(ref);
diff --git a/help.h b/help.h
index b8780fbd0fc3d0daacf029b3c3fcdd9a41bc733e..7a455beeb725e267946b1ac2c4d91ba9fee2a8c1 100644 (file)
--- a/help.h
+++ b/help.h
@@ -43,7 +43,7 @@ void list_commands(unsigned int colopts, struct cmdnames *main_cmds, struct cmdn
  * call this to die(), when it is suspected that the user mistyped a
  * ref to the command, to give suggested "correct" refs.
  */
-void help_unknown_ref(const char *ref, const char *cmd, const char *error);
+NORETURN void help_unknown_ref(const char *ref, const char *cmd, const char *error);
 
 static inline void list_config_item(struct string_list *list,
                                    const char *prefix,