From: Junio C Hamano Date: Mon, 23 Sep 2024 17:35:09 +0000 (-0700) Subject: Merge branch 'jc/pass-repo-to-builtins' X-Git-Tag: v2.47.0-rc0~14 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=b8e318ea58a0502ff99f37032ee8ac536df4e730;p=thirdparty%2Fgit.git Merge branch 'jc/pass-repo-to-builtins' The convention to calling into built-in command implementation has been updated to pass the repository, if known, together with the prefix value. * jc/pass-repo-to-builtins: add: pass in repo variable instead of global the_repository builtin: remove USE_THE_REPOSITORY for those without the_repository builtin: remove USE_THE_REPOSITORY_VARIABLE from builtin.h builtin: add a repository parameter for builtin functions --- b8e318ea58a0502ff99f37032ee8ac536df4e730 diff --cc builtin/count-objects.c index 42275f62d5,3d7b289f59..04d80887e0 --- a/builtin/count-objects.c +++ b/builtin/count-objects.c @@@ -7,9 -7,9 +7,8 @@@ #include "builtin.h" #include "config.h" #include "dir.h" -#include "environment.h" #include "gettext.h" #include "path.h" - #include "repository.h" #include "parse-options.h" #include "quote.h" #include "packfile.h" diff --cc builtin/fetch-pack.c index fe404d1305,d2c4304d22..49222a36fa --- a/builtin/fetch-pack.c +++ b/builtin/fetch-pack.c @@@ -43,10 -44,13 +44,13 @@@ static void add_sought_entry(struct re (*sought)[*nr - 1] = ref; } - int cmd_fetch_pack(int argc, const char **argv, const char *prefix UNUSED) + int cmd_fetch_pack(int argc, + const char **argv, + const char *prefix UNUSED, + struct repository *repo UNUSED) { int i, ret; - struct ref *ref = NULL; + struct ref *fetched_refs = NULL, *remote_refs = NULL; const char *dest = NULL; struct ref **sought = NULL; int nr_sought = 0, alloc_sought = 0; diff --cc builtin/write-tree.c index 9bcc4470ce,de4ebf767d..43f233e69b --- a/builtin/write-tree.c +++ b/builtin/write-tree.c @@@ -3,9 -3,10 +3,9 @@@ * * Copyright (C) Linus Torvalds, 2005 */ - + #define USE_THE_REPOSITORY_VARIABLE #include "builtin.h" #include "config.h" -#include "environment.h" #include "gettext.h" #include "hex.h" #include "tree.h"