summaryrefslogtreecommitdiff
path: root/builtin-annotate.c
blob: 25ad473711379d6f696a43020e065f9706da9841 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
/*
 * "git annotate" builtin alias
 *
 * Copyright (C) 2006 Ryan Anderson
 */
#include "git-compat-util.h"
#include "exec_cmd.h"

int cmd_annotate(int argc, const char **argv, const char *prefix)
{
	const char **nargv;
	int i;
	nargv = xmalloc(sizeof(char *) * (argc + 2));

	nargv[0] = "blame";
	nargv[1] = "-c";

	for (i = 1; i < argc; i++) {
		nargv[i+1] = argv[i];
	}
	nargv[argc + 1] = NULL;

	return execv_git_cmd(nargv);
}