diff options
| author | John Cai <johncai86@gmail.com> | 2024-09-13 21:16:14 +0000 |
|---|---|---|
| committer | Junio C Hamano <gitster@pobox.com> | 2024-09-13 14:27:08 -0700 |
| commit | 9b1cb5070ffb581798763eaee85cec10da969e90 (patch) | |
| tree | c33af160245f49cfa7d6e4e797c928a7a9f749ed /builtin/describe.c | |
| parent | The eleventh batch (diff) | |
| download | git-9b1cb5070ffb581798763eaee85cec10da969e90.tar.gz git-9b1cb5070ffb581798763eaee85cec10da969e90.zip | |
builtin: add a repository parameter for builtin functions
In order to reduce the usage of the global the_repository, add a
parameter to builtin functions that will get passed a repository
variable.
This commit uses UNUSED on most of the builtin functions, as subsequent
commits will modify the actual builtins to pass the repository parameter
down.
Signed-off-by: John Cai <johncai86@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin/describe.c')
| -rw-r--r-- | builtin/describe.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/builtin/describe.c b/builtin/describe.c index b43093c099..1c1c250fe0 100644 --- a/builtin/describe.c +++ b/builtin/describe.c @@ -571,7 +571,10 @@ static int option_parse_exact_match(const struct option *opt, const char *arg, return 0; } -int cmd_describe(int argc, const char **argv, const char *prefix) +int cmd_describe(int argc, + const char **argv, + const char *prefix, + struct repository *repo UNUSED ) { int contains = 0; struct option options[] = { @@ -650,7 +653,7 @@ int cmd_describe(int argc, const char **argv, const char *prefix) argv_copy[i] = args.v[i]; argv_copy[args.nr] = NULL; - ret = cmd_name_rev(args.nr, argv_copy, prefix); + ret = cmd_name_rev(args.nr, argv_copy, prefix, the_repository); strvec_clear(&args); free(argv_copy); |
