Skip to content

Commit 80e3658

Browse files
rscharfegitster
authored andcommitted
help: make help_unknown_ref() NORETURN
Announce that calling help_unknown_ref() exits the program. Signed-off-by: René Scharfe <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 75b2f01 commit 80e3658

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

help.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -774,7 +774,8 @@ static struct string_list guess_refs(const char *ref)
774774
return similar_refs;
775775
}
776776

777-
void help_unknown_ref(const char *ref, const char *cmd, const char *error)
777+
NORETURN void help_unknown_ref(const char *ref, const char *cmd,
778+
const char *error)
778779
{
779780
int i;
780781
struct string_list suggested_refs = guess_refs(ref);

help.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ void list_commands(unsigned int colopts, struct cmdnames *main_cmds, struct cmdn
4343
* call this to die(), when it is suspected that the user mistyped a
4444
* ref to the command, to give suggested "correct" refs.
4545
*/
46-
void help_unknown_ref(const char *ref, const char *cmd, const char *error);
46+
NORETURN void help_unknown_ref(const char *ref, const char *cmd, const char *error);
4747

4848
static inline void list_config_item(struct string_list *list,
4949
const char *prefix,

0 commit comments

Comments
 (0)