git/builtin/annotate.c
John Cai 03eae9afb4 builtin: remove USE_THE_REPOSITORY_VARIABLE from builtin.h
Instead of including USE_THE_REPOSITORY_VARIABLE by default on every
builtin, remove it from builtin.h and add it to all the builtins that
include builtin.h (by definition, that means all builtins/*.c).

Also, remove the include statement for repository.h since it gets
brought in through builtin.h.

The next step will be to migrate each builtin
from having to use the_repository.

Signed-off-by: John Cai <johncai86@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2024-09-13 14:32:24 -07:00

28 lines
513 B
C

/*
* "git annotate" builtin alias
*
* Copyright (C) 2006 Ryan Anderson
*/
#define USE_THE_REPOSITORY_VARIABLE
#include "git-compat-util.h"
#include "builtin.h"
#include "strvec.h"
int cmd_annotate(int argc,
const char **argv,
const char *prefix,
struct repository *repo UNUSED)
{
struct strvec args = STRVEC_INIT;
int i;
strvec_pushl(&args, "annotate", "-c", NULL);
for (i = 1; i < argc; i++) {
strvec_push(&args, argv[i]);
}
return cmd_blame(args.nr, args.v, prefix, the_repository);
}