summaryrefslogtreecommitdiff
path: root/usage.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2020-12-08 23:11:17 (GMT)
committerJunio C Hamano <gitster@pobox.com>2020-12-08 23:11:17 (GMT)
commit2aeafbc8967078b5b3804e03d48cc4d22fa045ca (patch)
tree4f7960f93be5ba54f0f6fb868afb850510748724 /usage.c
parent3a0b884caba2752da0af626fb2de7d597c844e8b (diff)
parent0ee10fd12968b78dbd1ccbba108599a24f31f70b (diff)
downloadgit-2aeafbc8967078b5b3804e03d48cc4d22fa045ca.zip
git-2aeafbc8967078b5b3804e03d48cc4d22fa045ca.tar.gz
git-2aeafbc8967078b5b3804e03d48cc4d22fa045ca.tar.bz2
Merge branch 'jt/trace-error-on-warning'
Like die() and error(), a call to warning() will also trigger a trace2 event. * jt/trace-error-on-warning: usage: add trace2 entry upon warning()
Diffstat (limited to 'usage.c')
-rw-r--r--usage.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/usage.c b/usage.c
index 0666582..1868a24 100644
--- a/usage.c
+++ b/usage.c
@@ -81,6 +81,12 @@ 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);
}