Merge branch 'maint-1.9' into maint
* maint-1.9: annotate: use argv_array
This commit is contained in:
commit
9092a9696b
@ -5,20 +5,18 @@
|
|||||||
*/
|
*/
|
||||||
#include "git-compat-util.h"
|
#include "git-compat-util.h"
|
||||||
#include "builtin.h"
|
#include "builtin.h"
|
||||||
|
#include "argv-array.h"
|
||||||
|
|
||||||
int cmd_annotate(int argc, const char **argv, const char *prefix)
|
int cmd_annotate(int argc, const char **argv, const char *prefix)
|
||||||
{
|
{
|
||||||
const char **nargv;
|
struct argv_array args = ARGV_ARRAY_INIT;
|
||||||
int i;
|
int i;
|
||||||
nargv = xmalloc(sizeof(char *) * (argc + 2));
|
|
||||||
|
|
||||||
nargv[0] = "annotate";
|
argv_array_pushl(&args, "annotate", "-c", NULL);
|
||||||
nargv[1] = "-c";
|
|
||||||
|
|
||||||
for (i = 1; i < argc; i++) {
|
for (i = 1; i < argc; i++) {
|
||||||
nargv[i+1] = argv[i];
|
argv_array_push(&args, argv[i]);
|
||||||
}
|
}
|
||||||
nargv[argc + 1] = NULL;
|
|
||||||
|
|
||||||
return cmd_blame(argc + 1, nargv, prefix);
|
return cmd_blame(args.argc, args.argv, prefix);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user