diff options
Diffstat (limited to 't/helper')
27 files changed, 58 insertions, 34 deletions
diff --git a/t/helper/test-cache-tree.c b/t/helper/test-cache-tree.c index 9507b356e2..e7236392c8 100644 --- a/t/helper/test-cache-tree.c +++ b/t/helper/test-cache-tree.c @@ -1,11 +1,11 @@ #define USE_THE_INDEX_VARIABLE #include "test-tool.h" -#include "cache.h" #include "gettext.h" #include "hex.h" #include "tree.h" #include "cache-tree.h" #include "parse-options.h" +#include "read-cache-ll.h" #include "repository.h" #include "setup.h" diff --git a/t/helper/test-config.c b/t/helper/test-config.c index ad78fc1768..ed444ca4c2 100644 --- a/t/helper/test-config.c +++ b/t/helper/test-config.c @@ -42,8 +42,11 @@ * */ -static int iterate_cb(const char *var, const char *value, void *data UNUSED) +static int iterate_cb(const char *var, const char *value, + const struct config_context *ctx, + void *data UNUSED) { + const struct key_value_info *kvi = ctx->kvi; static int nr; if (nr++) @@ -51,26 +54,29 @@ static int iterate_cb(const char *var, const char *value, void *data UNUSED) printf("key=%s\n", var); printf("value=%s\n", value ? value : "(null)"); - printf("origin=%s\n", current_config_origin_type()); - printf("name=%s\n", current_config_name()); - printf("lno=%d\n", current_config_line()); - printf("scope=%s\n", config_scope_name(current_config_scope())); + printf("origin=%s\n", config_origin_type_name(kvi->origin_type)); + printf("name=%s\n", kvi->filename ? kvi->filename : ""); + printf("lno=%d\n", kvi->linenr); + printf("scope=%s\n", config_scope_name(kvi->scope)); return 0; } -static int parse_int_cb(const char *var, const char *value, void *data) +static int parse_int_cb(const char *var, const char *value, + const struct config_context *ctx, void *data) { const char *key_to_match = data; if (!strcmp(key_to_match, var)) { - int parsed = git_config_int(value, value); + int parsed = git_config_int(value, value, ctx->kvi); printf("%d\n", parsed); } return 0; } -static int early_config_cb(const char *var, const char *value, void *vdata) +static int early_config_cb(const char *var, const char *value, + const struct config_context *ctx UNUSED, + void *vdata) { const char *key = vdata; @@ -176,7 +182,7 @@ int cmd__config(int argc, const char **argv) goto exit2; } } - if (!git_configset_get_value(&cs, argv[2], &v)) { + if (!git_configset_get_value(&cs, argv[2], &v, NULL)) { if (!v) printf("(NULL)\n"); else diff --git a/t/helper/test-dump-cache-tree.c b/t/helper/test-dump-cache-tree.c index f22f7bd84a..c38f546e4f 100644 --- a/t/helper/test-dump-cache-tree.c +++ b/t/helper/test-dump-cache-tree.c @@ -1,10 +1,10 @@ #define USE_THE_INDEX_VARIABLE #include "test-tool.h" -#include "cache.h" #include "hash.h" #include "hex.h" #include "tree.h" #include "cache-tree.h" +#include "read-cache-ll.h" #include "repository.h" #include "setup.h" diff --git a/t/helper/test-dump-fsmonitor.c b/t/helper/test-dump-fsmonitor.c index 9a098a25cb..4f215fea02 100644 --- a/t/helper/test-dump-fsmonitor.c +++ b/t/helper/test-dump-fsmonitor.c @@ -1,5 +1,5 @@ #include "test-tool.h" -#include "cache.h" +#include "read-cache-ll.h" #include "repository.h" #include "setup.h" diff --git a/t/helper/test-dump-split-index.c b/t/helper/test-dump-split-index.c index d1badd7112..5cf0b26dca 100644 --- a/t/helper/test-dump-split-index.c +++ b/t/helper/test-dump-split-index.c @@ -1,7 +1,8 @@ #define USE_THE_INDEX_VARIABLE #include "test-tool.h" -#include "cache.h" #include "hex.h" +#include "read-cache-ll.h" +#include "repository.h" #include "setup.h" #include "split-index.h" #include "ewah/ewok.h" diff --git a/t/helper/test-dump-untracked-cache.c b/t/helper/test-dump-untracked-cache.c index df70be549f..b4af9712fe 100644 --- a/t/helper/test-dump-untracked-cache.c +++ b/t/helper/test-dump-untracked-cache.c @@ -1,8 +1,8 @@ #define USE_THE_INDEX_VARIABLE #include "test-tool.h" -#include "cache.h" #include "dir.h" #include "hex.h" +#include "read-cache-ll.h" #include "repository.h" #include "setup.h" diff --git a/t/helper/test-fast-rebase.c b/t/helper/test-fast-rebase.c index d1d63feaa9..cac20a72b3 100644 --- a/t/helper/test-fast-rebase.c +++ b/t/helper/test-fast-rebase.c @@ -12,15 +12,16 @@ #define USE_THE_INDEX_VARIABLE #include "test-tool.h" -#include "cache.h" #include "cache-tree.h" #include "commit.h" #include "environment.h" #include "gettext.h" +#include "hash.h" #include "hex.h" #include "lockfile.h" #include "merge-ort.h" #include "object-name.h" +#include "read-cache-ll.h" #include "refs.h" #include "revision.h" #include "sequencer.h" diff --git a/t/helper/test-fsmonitor-client.c b/t/helper/test-fsmonitor-client.c index 9f18c685b7..58d1dc5fc8 100644 --- a/t/helper/test-fsmonitor-client.c +++ b/t/helper/test-fsmonitor-client.c @@ -4,9 +4,9 @@ */ #include "test-tool.h" -#include "cache.h" #include "parse-options.h" #include "fsmonitor-ipc.h" +#include "read-cache-ll.h" #include "repository.h" #include "setup.h" #include "thread-utils.h" diff --git a/t/helper/test-hash-speed.c b/t/helper/test-hash-speed.c index f40d9ad0c2..b235da594f 100644 --- a/t/helper/test-hash-speed.c +++ b/t/helper/test-hash-speed.c @@ -1,5 +1,5 @@ #include "test-tool.h" -#include "cache.h" +#include "hash-ll.h" #define NUM_SECONDS 3 diff --git a/t/helper/test-index-version.c b/t/helper/test-index-version.c index a06c45c1f8..f3c2dbe0a2 100644 --- a/t/helper/test-index-version.c +++ b/t/helper/test-index-version.c @@ -1,5 +1,5 @@ #include "test-tool.h" -#include "cache.h" +#include "read-cache-ll.h" int cmd__index_version(int argc UNUSED, const char **argv UNUSED) { diff --git a/t/helper/test-lazy-init-name-hash.c b/t/helper/test-lazy-init-name-hash.c index b83a75d19f..187a115d57 100644 --- a/t/helper/test-lazy-init-name-hash.c +++ b/t/helper/test-lazy-init-name-hash.c @@ -1,8 +1,9 @@ #define USE_THE_INDEX_VARIABLE #include "test-tool.h" -#include "cache.h" #include "environment.h" +#include "name-hash.h" #include "parse-options.h" +#include "read-cache-ll.h" #include "repository.h" #include "setup.h" #include "trace.h" diff --git a/t/helper/test-pack-mtimes.c b/t/helper/test-pack-mtimes.c index 0f3fbeec53..67a964ef90 100644 --- a/t/helper/test-pack-mtimes.c +++ b/t/helper/test-pack-mtimes.c @@ -1,7 +1,7 @@ #include "test-tool.h" #include "hex.h" #include "strbuf.h" -#include "object-store.h" +#include "object-store-ll.h" #include "packfile.h" #include "pack-mtimes.h" #include "setup.h" diff --git a/t/helper/test-partial-clone.c b/t/helper/test-partial-clone.c index 362bd64a4c..910a128614 100644 --- a/t/helper/test-partial-clone.c +++ b/t/helper/test-partial-clone.c @@ -1,7 +1,7 @@ #include "test-tool.h" #include "hex.h" #include "repository.h" -#include "object-store.h" +#include "object-store-ll.h" #include "setup.h" /* diff --git a/t/helper/test-path-utils.c b/t/helper/test-path-utils.c index 2ef53d5f7a..70396fa384 100644 --- a/t/helper/test-path-utils.c +++ b/t/helper/test-path-utils.c @@ -1,8 +1,8 @@ #include "test-tool.h" -#include "cache.h" #include "abspath.h" #include "environment.h" #include "path.h" +#include "read-cache-ll.h" #include "setup.h" #include "string-list.h" #include "trace.h" diff --git a/t/helper/test-read-cache.c b/t/helper/test-read-cache.c index c1ae276395..56c2d25f35 100644 --- a/t/helper/test-read-cache.c +++ b/t/helper/test-read-cache.c @@ -1,7 +1,7 @@ #define USE_THE_INDEX_VARIABLE #include "test-tool.h" -#include "cache.h" #include "config.h" +#include "read-cache-ll.h" #include "repository.h" #include "setup.h" #include "wrapper.h" diff --git a/t/helper/test-read-graph.c b/t/helper/test-read-graph.c index 3ac496e27e..8c7a83f578 100644 --- a/t/helper/test-read-graph.c +++ b/t/helper/test-read-graph.c @@ -1,7 +1,7 @@ #include "test-tool.h" #include "commit-graph.h" #include "repository.h" -#include "object-store.h" +#include "object-store-ll.h" #include "bloom.h" #include "setup.h" diff --git a/t/helper/test-read-midx.c b/t/helper/test-read-midx.c index 211addaa00..e9a444ddba 100644 --- a/t/helper/test-read-midx.c +++ b/t/helper/test-read-midx.c @@ -2,7 +2,7 @@ #include "hex.h" #include "midx.h" #include "repository.h" -#include "object-store.h" +#include "object-store-ll.h" #include "pack-bitmap.h" #include "packfile.h" #include "setup.h" diff --git a/t/helper/test-ref-store.c b/t/helper/test-ref-store.c index 6d8f844e9c..fb18831ec2 100644 --- a/t/helper/test-ref-store.c +++ b/t/helper/test-ref-store.c @@ -3,8 +3,11 @@ #include "refs.h" #include "setup.h" #include "worktree.h" -#include "object-store.h" +#include "object-store-ll.h" +#include "path.h" #include "repository.h" +#include "strbuf.h" +#include "revision.h" struct flag_definition { const char *name; @@ -116,8 +119,16 @@ static struct flag_definition pack_flags[] = { FLAG_DEF(PACK_REFS_PRUNE), static int cmd_pack_refs(struct ref_store *refs, const char **argv) { unsigned int flags = arg_flags(*argv++, "flags", pack_flags); + static struct ref_exclusions exclusions = REF_EXCLUSIONS_INIT; + static struct string_list included_refs = STRING_LIST_INIT_NODUP; + struct pack_refs_opts pack_opts = { .flags = flags, + .exclusions = &exclusions, + .includes = &included_refs }; - return refs_pack_refs(refs, flags); + if (pack_opts.flags & PACK_REFS_ALL) + string_list_append(pack_opts.includes, "*"); + + return refs_pack_refs(refs, &pack_opts); } static int cmd_create_symref(struct ref_store *refs, const char **argv) diff --git a/t/helper/test-repository.c b/t/helper/test-repository.c index bafd2a5bf9..4cd8a952e5 100644 --- a/t/helper/test-repository.c +++ b/t/helper/test-repository.c @@ -4,7 +4,7 @@ #include "config.h" #include "environment.h" #include "hex.h" -#include "object-store.h" +#include "object-store-ll.h" #include "object.h" #include "repository.h" #include "setup.h" diff --git a/t/helper/test-revision-walking.c b/t/helper/test-revision-walking.c index 0c62b9de18..f346951bc2 100644 --- a/t/helper/test-revision-walking.c +++ b/t/helper/test-revision-walking.c @@ -11,6 +11,7 @@ #include "test-tool.h" #include "commit.h" #include "diff.h" +#include "repository.h" #include "revision.h" #include "setup.h" diff --git a/t/helper/test-scrap-cache-tree.c b/t/helper/test-scrap-cache-tree.c index 6e17f50d22..0a816a96e2 100644 --- a/t/helper/test-scrap-cache-tree.c +++ b/t/helper/test-scrap-cache-tree.c @@ -1,7 +1,7 @@ #define USE_THE_INDEX_VARIABLE #include "test-tool.h" -#include "cache.h" #include "lockfile.h" +#include "read-cache-ll.h" #include "repository.h" #include "setup.h" #include "tree.h" diff --git a/t/helper/test-sha1.c b/t/helper/test-sha1.c index 71fe5c6145..dcb7f6c003 100644 --- a/t/helper/test-sha1.c +++ b/t/helper/test-sha1.c @@ -1,5 +1,5 @@ #include "test-tool.h" -#include "cache.h" +#include "hash-ll.h" int cmd__sha1(int ac, const char **av) { diff --git a/t/helper/test-sha256.c b/t/helper/test-sha256.c index 0ac6a99d5f..08cf149001 100644 --- a/t/helper/test-sha256.c +++ b/t/helper/test-sha256.c @@ -1,5 +1,5 @@ #include "test-tool.h" -#include "cache.h" +#include "hash-ll.h" int cmd__sha256(int ac, const char **av) { diff --git a/t/helper/test-strcmp-offset.c b/t/helper/test-strcmp-offset.c index 96b9a5b529..d8473cf2fc 100644 --- a/t/helper/test-strcmp-offset.c +++ b/t/helper/test-strcmp-offset.c @@ -1,5 +1,5 @@ #include "test-tool.h" -#include "cache.h" +#include "read-cache-ll.h" int cmd__strcmp_offset(int argc UNUSED, const char **argv) { diff --git a/t/helper/test-userdiff.c b/t/helper/test-userdiff.c index 680124a676..0ce31ce59f 100644 --- a/t/helper/test-userdiff.c +++ b/t/helper/test-userdiff.c @@ -12,7 +12,9 @@ static int driver_cb(struct userdiff_driver *driver, return 0; } -static int cmd__userdiff_config(const char *var, const char *value, void *cb UNUSED) +static int cmd__userdiff_config(const char *var, const char *value, + const struct config_context *ctx UNUSED, + void *cb UNUSED) { if (userdiff_config(var, value) < 0) return -1; diff --git a/t/helper/test-wildmatch.c b/t/helper/test-wildmatch.c index a95bb4da9b..b4ff5f986a 100644 --- a/t/helper/test-wildmatch.c +++ b/t/helper/test-wildmatch.c @@ -1,4 +1,5 @@ #include "test-tool.h" +#include "wildmatch.h" int cmd__wildmatch(int argc, const char **argv) { diff --git a/t/helper/test-write-cache.c b/t/helper/test-write-cache.c index eace08072d..f084034d38 100644 --- a/t/helper/test-write-cache.c +++ b/t/helper/test-write-cache.c @@ -1,7 +1,7 @@ #define USE_THE_INDEX_VARIABLE #include "test-tool.h" -#include "cache.h" #include "lockfile.h" +#include "read-cache-ll.h" #include "repository.h" #include "setup.h" |