aboutsummaryrefslogtreecommitdiff
path: root/usage.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2021-04-20 17:23:36 -0700
committerJunio C Hamano <gitster@pobox.com>2021-04-20 17:23:36 -0700
commitfdef940afecbd15d3cbb626bd9be9cceaa0a8daf (patch)
tree091ad53d36dd7addbfaa3a4c1592902f2645c9cb /usage.c
parent522010b5731b9864b5714e582e8dbfd55ee1b90b (diff)
parentf6d25d7878901f0ec9b7a9c07c584911fc0da2ff (diff)
downloadgit-fdef940afecbd15d3cbb626bd9be9cceaa0a8daf.tar.xz
Merge branch 'ab/usage-error-docs'
Documentation updates, with unrelated comment updates, too. * ab/usage-error-docs: api docs: document that BUG() emits a trace2 error event api docs: document BUG() in api-error-handling.txt usage.c: don't copy/paste the same comment three times
Diffstat (limited to 'usage.c')
-rw-r--r--usage.c17
1 files changed, 5 insertions, 12 deletions
diff --git a/usage.c b/usage.c
index 1b206de36d..c7d233b0de 100644
--- a/usage.c
+++ b/usage.c
@@ -55,12 +55,13 @@ static NORETURN void usage_builtin(const char *err, va_list params)
exit(129);
}
+/*
+ * We call trace2_cmd_error_va() in the below functions first and
+ * expect it to va_copy 'params' before using it (because an 'ap' can
+ * only be walked once).
+ */
static NORETURN void die_builtin(const char *err, va_list params)
{
- /*
- * We call this trace2 function first and expect it to va_copy 'params'
- * before using it (because an 'ap' can only be walked once).
- */
trace2_cmd_error_va(err, params);
vreportf("fatal: ", err, params);
@@ -70,10 +71,6 @@ static NORETURN void die_builtin(const char *err, va_list params)
static void error_builtin(const char *err, va_list params)
{
- /*
- * We call this trace2 function first and expect it to va_copy 'params'
- * before using it (because an 'ap' can only be walked once).
- */
trace2_cmd_error_va(err, params);
vreportf("error: ", err, params);
@@ -81,10 +78,6 @@ static void error_builtin(const char *err, va_list params)
static void warn_builtin(const char *warn, va_list params)
{
- /*
- * We call this trace2 function first and expect it to va_copy 'params'
- * before using it (because an 'ap' can only be walked once).
- */
trace2_cmd_error_va(warn, params);
vreportf("warning: ", warn, params);