Skip to content

Commit c00c738

Browse files
avargitster
authored andcommitted
usage.c: don't copy/paste the same comment three times
In ee4512e (trace2: create new combined trace facility, 2019-02-22) we started with two copies of this comment, 0ee10fd (usage: add trace2 entry upon warning(), 2020-11-23) added a third. Let's instead add an earlier comment that applies to all these mostly-the-same functions. Signed-off-by: Ævar Arnfjörð Bjarmason <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 89b43f8 commit c00c738

File tree

1 file changed

+5
-12
lines changed

1 file changed

+5
-12
lines changed

usage.c

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -55,12 +55,13 @@ static NORETURN void usage_builtin(const char *err, va_list params)
5555
exit(129);
5656
}
5757

58+
/*
59+
* We call trace2_cmd_error_va() in the below functions first and
60+
* expect it to va_copy 'params' before using it (because an 'ap' can
61+
* only be walked once).
62+
*/
5863
static NORETURN void die_builtin(const char *err, va_list params)
5964
{
60-
/*
61-
* We call this trace2 function first and expect it to va_copy 'params'
62-
* before using it (because an 'ap' can only be walked once).
63-
*/
6465
trace2_cmd_error_va(err, params);
6566

6667
vreportf("fatal: ", err, params);
@@ -70,21 +71,13 @@ static NORETURN void die_builtin(const char *err, va_list params)
7071

7172
static void error_builtin(const char *err, va_list params)
7273
{
73-
/*
74-
* We call this trace2 function first and expect it to va_copy 'params'
75-
* before using it (because an 'ap' can only be walked once).
76-
*/
7774
trace2_cmd_error_va(err, params);
7875

7976
vreportf("error: ", err, params);
8077
}
8178

8279
static void warn_builtin(const char *warn, va_list params)
8380
{
84-
/*
85-
* We call this trace2 function first and expect it to va_copy 'params'
86-
* before using it (because an 'ap' can only be walked once).
87-
*/
8881
trace2_cmd_error_va(warn, params);
8982

9083
vreportf("warning: ", warn, params);

0 commit comments

Comments
 (0)