2 * "git annotate" builtin alias
4 * Copyright (C) 2006 Ryan Anderson
7 #include "git-compat-util.h"
11 int cmd_annotate(int argc
,
14 struct repository
*repo
)
16 struct strvec args
= STRVEC_INIT
;
17 const char **args_copy
;
20 strvec_pushl(&args
, "annotate", "-c", NULL
);
21 for (int i
= 1; i
< argc
; i
++)
22 strvec_push(&args
, argv
[i
]);
25 * `cmd_blame()` ends up modifying the array, which causes memory leaks
26 * if we didn't copy the array here.
28 CALLOC_ARRAY(args_copy
, args
.nr
+ 1);
29 COPY_ARRAY(args_copy
, args
.v
, args
.nr
);
31 ret
= cmd_blame(args
.nr
, args_copy
, prefix
, repo
);