]> git.ipfire.org Git - thirdparty/git.git/commitdiff
setup.h: move declarations for setup.c functions from cache.h
authorElijah Newren <newren@gmail.com>
Tue, 21 Mar 2023 06:26:05 +0000 (06:26 +0000)
committerJunio C Hamano <gitster@pobox.com>
Tue, 21 Mar 2023 17:56:54 +0000 (10:56 -0700)
Signed-off-by: Elijah Newren <newren@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
105 files changed:
apply.c
archive.c
attr.c
blame.c
builtin/blame.c
builtin/bugreport.c
builtin/bundle.c
builtin/check-attr.c
builtin/check-ref-format.c
builtin/checkout-index.c
builtin/checkout.c
builtin/clean.c
builtin/clone.c
builtin/config.c
builtin/describe.c
builtin/diff-index.c
builtin/diff.c
builtin/difftool.c
builtin/gc.c
builtin/grep.c
builtin/hash-object.c
builtin/help.c
builtin/index-pack.c
builtin/init-db.c
builtin/ls-files.c
builtin/merge-file.c
builtin/mv.c
builtin/read-tree.c
builtin/reset.c
builtin/rev-parse.c
builtin/rm.c
builtin/shortlog.c
builtin/sparse-checkout.c
builtin/stash.c
builtin/stripspace.c
builtin/submodule--helper.c
builtin/update-index.c
cache.h
commit.c
common-main.c
config.c
daemon.c
diff.c
dir.c
environment.c
git.c
http-fetch.c
http-push.c
imap-send.c
line-log.c
mailmap.c
object-file.c
object-name.c
path.c
pathspec.c
refs.c
refs/files-backend.c
remote-curl.c
remote.c
repository.c
revision.c
scalar.c
setup.c
setup.h [new file with mode: 0644]
submodule.c
symlinks.c
t/helper/test-advise.c
t/helper/test-bitmap.c
t/helper/test-bloom.c
t/helper/test-cache-tree.c
t/helper/test-config.c
t/helper/test-dump-cache-tree.c
t/helper/test-dump-fsmonitor.c
t/helper/test-dump-split-index.c
t/helper/test-dump-untracked-cache.c
t/helper/test-fast-rebase.c
t/helper/test-fsmonitor-client.c
t/helper/test-lazy-init-name-hash.c
t/helper/test-match-trees.c
t/helper/test-oid-array.c
t/helper/test-oidmap.c
t/helper/test-oidtree.c
t/helper/test-pack-mtimes.c
t/helper/test-partial-clone.c
t/helper/test-path-utils.c
t/helper/test-proc-receive.c
t/helper/test-reach.c
t/helper/test-read-cache.c
t/helper/test-read-graph.c
t/helper/test-read-midx.c
t/helper/test-ref-store.c
t/helper/test-repository.c
t/helper/test-revision-walking.c
t/helper/test-scrap-cache-tree.c
t/helper/test-serve-v2.c
t/helper/test-submodule-config.c
t/helper/test-submodule-nested-repo-config.c
t/helper/test-submodule.c
t/helper/test-subprocess.c
t/helper/test-userdiff.c
t/helper/test-write-cache.c
trace.c
unpack-trees.c
worktree.c
wt-status.c

diff --git a/apply.c b/apply.c
index a7c0bccb15c94c32a3d778b94ef686c4fadc7a2a..caa2e0a3bc66ee5a7535029392c7ec9c86f569f8 100644 (file)
--- a/apply.c
+++ b/apply.c
@@ -27,6 +27,7 @@
 #include "rerere.h"
 #include "apply.h"
 #include "entry.h"
+#include "setup.h"
 #include "wrapper.h"
 
 struct gitdiff_data {
index 7aeaaf368f437eb2941afe03f7c81950ab43f1cc..cdce5b783a78711341fcdb35e504dd8935a5e2f5 100644 (file)
--- a/archive.c
+++ b/archive.c
@@ -5,6 +5,7 @@
 #include "environment.h"
 #include "gettext.h"
 #include "hex.h"
+#include "setup.h"
 #include "refs.h"
 #include "object-store.h"
 #include "commit.h"
diff --git a/attr.c b/attr.c
index 62127196cb1ad3106d2fc3836c52783706c7df32..2d8aeb8b58cbc0f19f050bce768b06f0c6f4b705 100644 (file)
--- a/attr.c
+++ b/attr.c
@@ -18,6 +18,7 @@
 #include "quote.h"
 #include "revision.h"
 #include "object-store.h"
+#include "setup.h"
 #include "thread-utils.h"
 
 const char git_attr__true[] = "(builtin)true";
diff --git a/blame.c b/blame.c
index b7cd849bb6b16a1071250a4cfbd63fee6d0e99af..838eb128f01afb3de6b35d1f12fdf756f02fb7ee 100644 (file)
--- a/blame.c
+++ b/blame.c
@@ -7,6 +7,7 @@
 #include "diffcore.h"
 #include "gettext.h"
 #include "hex.h"
+#include "setup.h"
 #include "tag.h"
 #include "blame.h"
 #include "alloc.h"
index 9ec82edcbde540ffd0ff2c615742b43ac4a5fab0..fb271bae70ef03340ea4e384baf0215680e6bcd1 100644 (file)
@@ -31,6 +31,7 @@
 #include "object-store.h"
 #include "blame.h"
 #include "refs.h"
+#include "setup.h"
 #include "tag.h"
 
 static char blame_usage[] = N_("git blame [<options>] [<rev-opts>] [<rev>] [--] <file>");
index 160590e4ef609a0d0549cbc8722504cc2c6c259e..52955e1d389bbd92628a0329a17998a0b8513cfd 100644 (file)
@@ -8,6 +8,7 @@
 #include "hook.h"
 #include "hook-list.h"
 #include "diagnose.h"
+#include "setup.h"
 #include "wrapper.h"
 
 static void get_system_info(struct strbuf *sys_info)
index 9e2aecadf7d51d07a88e25cc47a4d539ee7b62f3..e68fc83d94323582d3eb46a1cc96918c04f323db 100644 (file)
@@ -1,6 +1,7 @@
 #include "builtin.h"
 #include "abspath.h"
 #include "gettext.h"
+#include "setup.h"
 #include "strvec.h"
 #include "parse-options.h"
 #include "cache.h"
index 5870c4683abd7b6b2eaae6655ae1af43f1f3dbe7..ec37b8164af15abb6e6baed266eb7e67ed2ede08 100644 (file)
@@ -6,6 +6,7 @@
 #include "environment.h"
 #include "gettext.h"
 #include "quote.h"
+#include "setup.h"
 #include "parse-options.h"
 
 static int all_attrs;
index fd0e5f86832a0ed4d9c08512291c836938f2bec2..b0263467424f2f7459a0277210f2bc1b5ee391e7 100644 (file)
@@ -5,6 +5,7 @@
 #include "cache.h"
 #include "refs.h"
 #include "builtin.h"
+#include "setup.h"
 #include "strbuf.h"
 
 static const char builtin_check_ref_format_usage[] =
index 828c0363f8aa6eac3c4bd9a0df1b88f0079a918c..7df673e3e70c26dd10407060623e1276f343f432 100644 (file)
@@ -15,6 +15,7 @@
 #include "parse-options.h"
 #include "entry.h"
 #include "parallel-checkout.h"
+#include "setup.h"
 
 #define CHECKOUT_ALL 4
 static int nul_term_line;
index 5541e76c3374fa0de3fc3f0df0fdfa6b69d28102..73b6e581f391b32c31a229ee9ba8678cc227f116 100644 (file)
@@ -23,6 +23,7 @@
 #include "resolve-undo.h"
 #include "revision.h"
 #include "run-command.h"
+#include "setup.h"
 #include "submodule.h"
 #include "submodule-config.h"
 #include "tree.h"
index fdcf62c5dfe6aa2102c4380fa6c753dffa7004a6..14c0d555eac8af68ec2ac5d3cad3afe5b5240aa5 100644 (file)
@@ -14,6 +14,7 @@
 #include "dir.h"
 #include "gettext.h"
 #include "parse-options.h"
+#include "setup.h"
 #include "string-list.h"
 #include "quote.h"
 #include "column.h"
index 15dc15408ed57862220cec771f29df4a9afb831d..34f46965b9567304d3ac95e2398ce8aa88fe7397 100644 (file)
@@ -33,6 +33,7 @@
 #include "branch.h"
 #include "remote.h"
 #include "run-command.h"
+#include "setup.h"
 #include "connected.h"
 #include "packfile.h"
 #include "list-objects-filter-options.h"
index cf994a216c019dde85067045cd39e1e1a8928d8f..fe79fb60c4377bce46fa56f44e7534cf7b96e0d8 100644 (file)
@@ -9,6 +9,7 @@
 #include "parse-options.h"
 #include "urlmatch.h"
 #include "quote.h"
+#include "setup.h"
 #include "worktree.h"
 #include "wrapper.h"
 
index 27c6670e934079cb621ca07082c0b79d9ea2e75b..43b62348bc739256c992fd348df184da87a41a26 100644 (file)
@@ -15,6 +15,7 @@
 #include "revision.h"
 #include "diff.h"
 #include "hashmap.h"
+#include "setup.h"
 #include "strvec.h"
 #include "run-command.h"
 #include "object-store.h"
index 35dc9b23eef32d81e1e0a1b42a810ca6d95f58a2..b9a19bb7d38074a907369c74b9cd72c98ac208c7 100644 (file)
@@ -5,6 +5,7 @@
 #include "commit.h"
 #include "revision.h"
 #include "builtin.h"
+#include "setup.h"
 #include "submodule.h"
 
 static const char diff_cache_usage[] =
index 20bdb6e6cecdd6549bf0bf1ce38d23b8318a488a..3945683bfe459039fa8d22e7a3555e25cbc30445 100644 (file)
@@ -19,6 +19,7 @@
 #include "revision.h"
 #include "log-tree.h"
 #include "builtin.h"
+#include "setup.h"
 #include "submodule.h"
 #include "oid-array.h"
 
index 3613de6389f9214c77200da92ff765083d958990..176437d6da36ec73e37654047bfa4c38b243ae36 100644 (file)
@@ -28,6 +28,7 @@
 #include "object-store.h"
 #include "dir.h"
 #include "entry.h"
+#include "setup.h"
 #include "wrapper.h"
 
 static int trust_exit_code;
index 525c5de5b274c69ebb226ca796fabba384cfbf98..a85f9e3ed3d1281844de019f76f7a0c0a02715b7 100644 (file)
@@ -36,6 +36,7 @@
 #include "exec-cmd.h"
 #include "gettext.h"
 #include "hook.h"
+#include "setup.h"
 #include "wrapper.h"
 
 #define FAILED_RUN "failed to run %s"
index 3c9c6b3803168b62cd3205c3298683e7ae3e4e46..b8ebf014f403de391084d96c85041b729a6ae861 100644 (file)
@@ -23,6 +23,7 @@
 #include "quote.h"
 #include "dir.h"
 #include "pathspec.h"
+#include "setup.h"
 #include "submodule.h"
 #include "submodule-config.h"
 #include "object-store.h"
index 7651a7a5f56dfe4f81a63be6cb2559738c384bb2..a2e160db0265ba3102606637e060587f4aa603b0 100644 (file)
@@ -14,6 +14,7 @@
 #include "quote.h"
 #include "parse-options.h"
 #include "exec-cmd.h"
+#include "setup.h"
 
 /*
  * This is to create corrupt objects for debugging and as such it
index 3fde5c4fd354e530ce23db4e0917288e32d91da6..87333a02ec40adb4e2b2b613b840c36f066f4e52 100644 (file)
@@ -11,6 +11,7 @@
 #include "config-list.h"
 #include "help.h"
 #include "alias.h"
+#include "setup.h"
 
 #ifndef DEFAULT_HELP_FORMAT
 #define DEFAULT_HELP_FORMAT "man"
index fdce8f8872433cd8b9b49ab68f4b37bf82dab42c..823dc5aefb5ab957e1e9acdc186ce42400013dc9 100644 (file)
@@ -20,6 +20,7 @@
 #include "object-store.h"
 #include "replace-object.h"
 #include "promisor-remote.h"
+#include "setup.h"
 #include "wrapper.h"
 
 static const char index_pack_usage[] =
index 2ebc9023f5624a254e8b3abf2ae50e5d00531763..ba6e0b20fa524e2f4fdb5d43dd977ed2046a36f1 100644 (file)
@@ -12,6 +12,7 @@
 #include "builtin.h"
 #include "exec-cmd.h"
 #include "parse-options.h"
+#include "setup.h"
 #include "worktree.h"
 #include "wrapper.h"
 
index 09deb752ab35f375db4f9b517e5cf7808e31122c..4a8de95ddc456982a8211e53bca1247f0afd8d61 100644 (file)
@@ -20,6 +20,7 @@
 #include "string-list.h"
 #include "pathspec.h"
 #include "run-command.h"
+#include "setup.h"
 #include "submodule.h"
 #include "submodule-config.h"
 
index c0096ee0810961400346608cebfb77ab798eb06f..781818d08f560714303889ff9eb002408307e244 100644 (file)
@@ -3,6 +3,7 @@
 #include "cache.h"
 #include "config.h"
 #include "gettext.h"
+#include "setup.h"
 #include "xdiff/xdiff.h"
 #include "xdiff-interface.h"
 #include "parse-options.h"
index c2dd42efbf20522253db649d8d3e7c324bc36a57..b7c5ffbd8c796f5848523ac8fbe450ce425be13d 100644 (file)
@@ -16,6 +16,7 @@
 #include "cache-tree.h"
 #include "string-list.h"
 #include "parse-options.h"
+#include "setup.h"
 #include "submodule.h"
 #include "entry.h"
 
index ec66008d07e098c5272633f390e07e020c1fc602..5f24453dcd7e954072ef9d96be3366862353b900 100644 (file)
@@ -19,6 +19,7 @@
 #include "builtin.h"
 #include "parse-options.h"
 #include "resolve-undo.h"
+#include "setup.h"
 #include "submodule.h"
 #include "submodule-config.h"
 
index b5dfce1159e65887b5866ad9da4847bb89425a8a..af2afc2c982079b4b74a38d7d747ca4c9a2b11c7 100644 (file)
@@ -26,6 +26,7 @@
 #include "parse-options.h"
 #include "unpack-trees.h"
 #include "cache-tree.h"
+#include "setup.h"
 #include "submodule.h"
 #include "submodule-config.h"
 #include "dir.h"
index bba49d56b9f11f219922b445f2773ea7ee574c8b..3a5a2ee5b2d02bfa60946db975616b89ba764923 100644 (file)
@@ -18,6 +18,7 @@
 #include "parse-options.h"
 #include "diff.h"
 #include "revision.h"
+#include "setup.h"
 #include "split-index.h"
 #include "submodule.h"
 #include "commit-reach.h"
index 5982c3d8122cca0172f299874ceb222209eb0f22..97775e4c4d0d508cebffdb8f487290e5cda08de3 100644 (file)
@@ -15,6 +15,7 @@
 #include "tree-walk.h"
 #include "parse-options.h"
 #include "string-list.h"
+#include "setup.h"
 #include "submodule.h"
 #include "pathspec.h"
 
index 31f81c25ea27f51ade41c4ca05aa3c7e7fa45f17..59d9c440fb59343b2cf6076145c76a168aaca753 100644 (file)
@@ -9,6 +9,7 @@
 #include "revision.h"
 #include "utf8.h"
 #include "mailmap.h"
+#include "setup.h"
 #include "shortlog.h"
 #include "parse-options.h"
 #include "trailer.h"
index f6a120c7c45e3f68ff36f9c4212f9deb562b0ee5..512df0f8f5466f532b6f3f0dc42eac514e803171 100644 (file)
@@ -16,6 +16,7 @@
 #include "unpack-trees.h"
 #include "wt-status.h"
 #include "quote.h"
+#include "setup.h"
 #include "sparse-index.h"
 #include "worktree.h"
 
index 94f81d75d034b8fcdb4ce50427a3d3d95b62571a..30d547fff1fbdb1148852a8bf39e33761674400b 100644 (file)
@@ -18,6 +18,7 @@
 #include "entry.h"
 #include "rerere.h"
 #include "revision.h"
+#include "setup.h"
 #include "log-tree.h"
 #include "diffcore.h"
 #include "exec-cmd.h"
index d8e614593333774903a28586b2d555dec2bcf3f9..53930458ffa9af41ad097e6dec3173a3cbf404a9 100644 (file)
@@ -3,6 +3,7 @@
 #include "config.h"
 #include "gettext.h"
 #include "parse-options.h"
+#include "setup.h"
 #include "strbuf.h"
 
 static void comment_lines(struct strbuf *buf)
index 2bf2a1a8be5e35ed60af4d3487424b17f1dcb07c..3cb4a3ce2174d524f2124b58450045c348a6a09d 100644 (file)
@@ -12,6 +12,7 @@
 #include "quote.h"
 #include "pathspec.h"
 #include "dir.h"
+#include "setup.h"
 #include "submodule.h"
 #include "submodule-config.h"
 #include "string-list.h"
index 4642afaeb771b77d1d734fc97aa8d252e74a9ff1..f97f8d4c9d5fcfd92c58c049810847be3c8a7d02 100644 (file)
@@ -20,6 +20,7 @@
 #include "parse-options.h"
 #include "pathspec.h"
 #include "dir.h"
+#include "setup.h"
 #include "split-index.h"
 #include "fsmonitor.h"
 
diff --git a/cache.h b/cache.h
index 720c88f9fd63685e8e256f7477803b6a6317a5e1..bffedd240e71d16a40adb61d18ebac9c127f10a6 100644 (file)
--- a/cache.h
+++ b/cache.h
@@ -452,67 +452,6 @@ static inline enum object_type object_type(unsigned int mode)
                OBJ_BLOB;
 }
 
-int is_inside_git_dir(void);
-int is_inside_work_tree(void);
-int get_common_dir_noenv(struct strbuf *sb, const char *gitdir);
-int get_common_dir(struct strbuf *sb, const char *gitdir);
-
-/*
- * Return true if the given path is a git directory; note that this _just_
- * looks at the directory itself. If you want to know whether "foo/.git"
- * is a repository, you must feed that path, not just "foo".
- */
-int is_git_directory(const char *path);
-
-/*
- * Return 1 if the given path is the root of a git repository or
- * submodule, else 0. Will not return 1 for bare repositories with the
- * exception of creating a bare repository in "foo/.git" and calling
- * is_git_repository("foo").
- *
- * If we run into read errors, we err on the side of saying "yes, it is",
- * as we usually consider sub-repos precious, and would prefer to err on the
- * side of not disrupting or deleting them.
- */
-int is_nonbare_repository_dir(struct strbuf *path);
-
-#define READ_GITFILE_ERR_STAT_FAILED 1
-#define READ_GITFILE_ERR_NOT_A_FILE 2
-#define READ_GITFILE_ERR_OPEN_FAILED 3
-#define READ_GITFILE_ERR_READ_FAILED 4
-#define READ_GITFILE_ERR_INVALID_FORMAT 5
-#define READ_GITFILE_ERR_NO_PATH 6
-#define READ_GITFILE_ERR_NOT_A_REPO 7
-#define READ_GITFILE_ERR_TOO_LARGE 8
-void read_gitfile_error_die(int error_code, const char *path, const char *dir);
-const char *read_gitfile_gently(const char *path, int *return_error_code);
-#define read_gitfile(path) read_gitfile_gently((path), NULL)
-const char *resolve_gitdir_gently(const char *suspect, int *return_error_code);
-#define resolve_gitdir(path) resolve_gitdir_gently((path), NULL)
-
-void setup_work_tree(void);
-/*
- * Find the commondir and gitdir of the repository that contains the current
- * working directory, without changing the working directory or other global
- * state. The result is appended to commondir and gitdir.  If the discovered
- * gitdir does not correspond to a worktree, then 'commondir' and 'gitdir' will
- * both have the same result appended to the buffer.  The return value is
- * either 0 upon success and non-zero if no repository was found.
- */
-int discover_git_directory(struct strbuf *commondir,
-                          struct strbuf *gitdir);
-const char *setup_git_directory_gently(int *);
-const char *setup_git_directory(void);
-char *prefix_path(const char *prefix, int len, const char *path);
-char *prefix_path_gently(const char *prefix, int len, int *remaining, const char *path);
-
-int check_filename(const char *prefix, const char *name);
-void verify_filename(const char *prefix,
-                    const char *name,
-                    int diagnose_misspelt_rev);
-void verify_non_filename(const char *prefix, const char *name);
-int path_inside_repo(const char *prefix, const char *path);
-
 #define INIT_DB_QUIET 0x0001
 #define INIT_DB_EXIST_OK 0x0002
 
@@ -521,9 +460,6 @@ int init_db(const char *git_dir, const char *real_git_dir,
            const char *initial_branch, unsigned int flags);
 void initialize_repository_version(int hash_algo, int reinit);
 
-void sanitize_stdfds(void);
-int daemonize(void);
-
 /* Initialize and use the cache information */
 struct lock_file;
 void preload_index(struct index_state *index,
@@ -807,79 +743,6 @@ enum fsync_method {
 
 extern enum fsync_method fsync_method;
 
-/*
- * GIT_REPO_VERSION is the version we write by default. The
- * _READ variant is the highest number we know how to
- * handle.
- */
-#define GIT_REPO_VERSION 0
-#define GIT_REPO_VERSION_READ 1
-
-/*
- * You _have_ to initialize a `struct repository_format` using
- * `= REPOSITORY_FORMAT_INIT` before calling `read_repository_format()`.
- */
-struct repository_format {
-       int version;
-       int precious_objects;
-       char *partial_clone; /* value of extensions.partialclone */
-       int worktree_config;
-       int is_bare;
-       int hash_algo;
-       int sparse_index;
-       char *work_tree;
-       struct string_list unknown_extensions;
-       struct string_list v1_only_extensions;
-};
-
-/*
- * Always use this to initialize a `struct repository_format`
- * to a well-defined, default state before calling
- * `read_repository()`.
- */
-#define REPOSITORY_FORMAT_INIT \
-{ \
-       .version = -1, \
-       .is_bare = -1, \
-       .hash_algo = GIT_HASH_SHA1, \
-       .unknown_extensions = STRING_LIST_INIT_DUP, \
-       .v1_only_extensions = STRING_LIST_INIT_DUP, \
-}
-
-/*
- * Read the repository format characteristics from the config file "path" into
- * "format" struct. Returns the numeric version. On error, or if no version is
- * found in the configuration, -1 is returned, format->version is set to -1,
- * and all other fields in the struct are set to the default configuration
- * (REPOSITORY_FORMAT_INIT). Always initialize the struct using
- * REPOSITORY_FORMAT_INIT before calling this function.
- */
-int read_repository_format(struct repository_format *format, const char *path);
-
-/*
- * Free the memory held onto by `format`, but not the struct itself.
- * (No need to use this after `read_repository_format()` fails.)
- */
-void clear_repository_format(struct repository_format *format);
-
-/*
- * Verify that the repository described by repository_format is something we
- * can read. If it is, return 0. Otherwise, return -1, and "err" will describe
- * any errors encountered.
- */
-int verify_repository_format(const struct repository_format *format,
-                            struct strbuf *err);
-
-/*
- * Check the repository format version in the path found in get_git_dir(),
- * and die if it is a version we don't understand. Generally one would
- * set_git_dir() before calling this, and use it only for "are we in a valid
- * repo?".
- *
- * If successful and fmt is not NULL, fill fmt with data.
- */
-void check_repository_format(struct repository_format *fmt);
-
 #define MTIME_CHANGED  0x0001
 #define CTIME_CHANGED  0x0002
 #define OWNER_CHANGED  0x0004
@@ -908,23 +771,6 @@ const char *repo_find_unique_abbrev(struct repository *r, const struct object_id
 int repo_find_unique_abbrev_r(struct repository *r, char *hex, const struct object_id *oid, int len);
 #define find_unique_abbrev_r(hex, oid, len) repo_find_unique_abbrev_r(the_repository, hex, oid, len)
 
-/*
- * NOTE NOTE NOTE!!
- *
- * PERM_UMASK, OLD_PERM_GROUP and OLD_PERM_EVERYBODY enumerations must
- * not be changed. Old repositories have core.sharedrepository written in
- * numeric format, and therefore these values are preserved for compatibility
- * reasons.
- */
-enum sharedrepo {
-       PERM_UMASK          = 0,
-       OLD_PERM_GROUP      = 1,
-       OLD_PERM_EVERYBODY  = 2,
-       PERM_GROUP          = 0660,
-       PERM_EVERYBODY      = 0664
-};
-int git_config_perm(const char *var, const char *value);
-
 /*
  * Create the directory containing the named path, using care to be
  * somewhat safe against races. Return one of the scld_error values to
@@ -1283,15 +1129,6 @@ int ws_blank_line(const char *line, int len);
 void overlay_tree_on_index(struct index_state *istate,
                           const char *tree_name, const char *prefix);
 
-/* setup.c */
-struct startup_info {
-       int have_repository;
-       const char *prefix;
-       const char *original_cwd;
-};
-extern struct startup_info *startup_info;
-extern const char *tmp_original_cwd;
-
 /* merge.c */
 struct commit_list;
 int try_merge_command(struct repository *r,
index f88fc5e1a2cd8c8230beebdc10486f8ee4bca51d..3868f047f1b532d08898ae4795d40555b1208313 100644 (file)
--- a/commit.c
+++ b/commit.c
@@ -23,6 +23,7 @@
 #include "refs.h"
 #include "commit-reach.h"
 #include "run-command.h"
+#include "setup.h"
 #include "shallow.h"
 #include "hook.h"
 
index 184d1534d2dd0d4f411f9ff89b4a28875779a7d9..b83cb5cf066732be125e8a5912d56405fed741d3 100644 (file)
@@ -2,6 +2,7 @@
 #include "exec-cmd.h"
 #include "gettext.h"
 #include "attr.h"
+#include "setup.h"
 
 /*
  * Many parts of Git have subprograms communicate via pipe, expect the
index 5b1a5d52052ca0219a95d25639adbfe327ec66fd..03a4fcaba5ba789513a885e43ca283b76e4f692e 100644 (file)
--- a/config.c
+++ b/config.c
@@ -27,6 +27,7 @@
 #include "color.h"
 #include "replace-object.h"
 #include "refs.h"
+#include "setup.h"
 #include "worktree.h"
 #include "wrapper.h"
 
index b56a8f9717d68d0cdc4cf38316eac2ccc4fcac13..db8a31a6ea2145a4c3c2a44caaa82d0ed9e9c278 100644 (file)
--- a/daemon.c
+++ b/daemon.c
@@ -5,6 +5,7 @@
 #include "environment.h"
 #include "pkt-line.h"
 #include "run-command.h"
+#include "setup.h"
 #include "strbuf.h"
 #include "string-list.h"
 #include "wrapper.h"
diff --git a/diff.c b/diff.c
index dcf1a940942c22ad1d0c8ee971395c33cb40cbe7..b858e59c5ae7fc299f8dba0b0eca9df4c4e2b511 100644 (file)
--- a/diff.c
+++ b/diff.c
@@ -33,6 +33,7 @@
 #include "help.h"
 #include "promisor-remote.h"
 #include "dir.h"
+#include "setup.h"
 #include "strmap.h"
 #include "wrapper.h"
 
diff --git a/dir.c b/dir.c
index 06f8aa3c01bef0cb6b31d3b1ca30d3ef96cf8989..4cc2b1ead4785df4d46949d1d6d9e0a59891af6f 100644 (file)
--- a/dir.c
+++ b/dir.c
@@ -21,6 +21,7 @@
 #include "varint.h"
 #include "ewah/ewok.h"
 #include "fsmonitor.h"
+#include "setup.h"
 #include "submodule-config.h"
 #include "wrapper.h"
 
index bf02f3cf4876a7c7f94781a897ed80b21f4631d3..649d16ac27c49556689f0a05de5fb94abdc7ba70 100644 (file)
@@ -22,6 +22,7 @@
 #include "replace-object.h"
 #include "tmp-objdir.h"
 #include "chdir-notify.h"
+#include "setup.h"
 #include "shallow.h"
 #include "wrapper.h"
 
diff --git a/git.c b/git.c
index b24c105e83f96a52c2276d15353878c9da4d4fc6..77f920a6f6fcf997b583505fd29277acb00f8524 100644 (file)
--- a/git.c
+++ b/git.c
@@ -7,6 +7,7 @@
 #include "run-command.h"
 #include "alias.h"
 #include "replace-object.h"
+#include "setup.h"
 #include "shallow.h"
 
 #define RUN_SETUP              (1<<0)
index 454933351b28ad869e3f83f84227d0fd606d6f40..c874d3402dd920e97704b22650e7873a2b3e3bb5 100644 (file)
@@ -5,6 +5,7 @@
 #include "hex.h"
 #include "http.h"
 #include "walker.h"
+#include "setup.h"
 #include "strvec.h"
 #include "urlmatch.h"
 #include "trace2.h"
index 40373bc4863535e3d042023a6cf508af87577f75..e73864b51f51f4c933d993db6b10a2a4b243805c 100644 (file)
@@ -12,6 +12,7 @@
 #include "exec-cmd.h"
 #include "remote.h"
 #include "list-objects.h"
+#include "setup.h"
 #include "sigchain.h"
 #include "strvec.h"
 #include "packfile.h"
index aa5b2f252d24e2e2bb06eb5e599b23c142a215d5..a62424e90a4d52e933749298529829cf267bb6b0 100644 (file)
@@ -28,6 +28,7 @@
 #include "gettext.h"
 #include "run-command.h"
 #include "parse-options.h"
+#include "setup.h"
 #include "wrapper.h"
 #if defined(NO_OPENSSL) && !defined(HAVE_OPENSSL_CSPRNG)
 typedef void *SSL;
index 6e7fc4b2e0baa7d56e1b205213a752b70c3037e8..84c8093c517ec06383c7e26f537e1b6bc0cd6a4c 100644 (file)
@@ -16,6 +16,7 @@
 #include "graph.h"
 #include "userdiff.h"
 #include "line-log.h"
+#include "setup.h"
 #include "strvec.h"
 #include "bloom.h"
 
index 2c6e9b238dd8493171dfb09d9a8cf22c5b985437..c24a16eaf4881317a921f3716f539d6276fb6082 100644 (file)
--- a/mailmap.c
+++ b/mailmap.c
@@ -3,6 +3,7 @@
 #include "string-list.h"
 #include "mailmap.h"
 #include "object-store.h"
+#include "setup.h"
 
 #define DEBUG_MAILMAP 0
 #if DEBUG_MAILMAP
index 3da6cd688611d68173f1c7650fb8d2dcf4227d9e..05fff230f73990ec3d5452ada2a09ecadd844aea 100644 (file)
@@ -37,6 +37,7 @@
 #include "packfile.h"
 #include "object-store.h"
 #include "promisor-remote.h"
+#include "setup.h"
 #include "submodule.h"
 #include "fsck.h"
 #include "wrapper.h"
index 3b0ce8ef05a79da2785d6e699f6134cb7ae24a28..ce973e015059289d8d226796fb9380a2d7b400ac 100644 (file)
@@ -15,6 +15,7 @@
 #include "packfile.h"
 #include "object-store.h"
 #include "repository.h"
+#include "setup.h"
 #include "submodule.h"
 #include "midx.h"
 #include "commit-reach.h"
diff --git a/path.c b/path.c
index 5d5a15c13d61cbf31ad3a3410110d26ad55c8f15..a17024349797b93ea78c620605e16d9ee81cef32 100644 (file)
--- a/path.c
+++ b/path.c
@@ -11,6 +11,7 @@
 #include "string-list.h"
 #include "dir.h"
 #include "worktree.h"
+#include "setup.h"
 #include "submodule-config.h"
 #include "path.h"
 #include "packfile.h"
index 5fb7b5f26c985eaa1104abe537ada5816a677c13..6972d515f0c7dbb93292361720603d9a80bfa44e 100644 (file)
@@ -6,6 +6,7 @@
 #include "gettext.h"
 #include "pathspec.h"
 #include "attr.h"
+#include "setup.h"
 #include "strvec.h"
 #include "quote.h"
 
diff --git a/refs.c b/refs.c
index 04520e5a6b82fb566d1244c8da9ac573576d8003..21b317e815361d27295c5dfb195fe24a5c3b6a38 100644 (file)
--- a/refs.c
+++ b/refs.c
@@ -22,6 +22,7 @@
 #include "worktree.h"
 #include "strvec.h"
 #include "repository.h"
+#include "setup.h"
 #include "sigchain.h"
 #include "date.h"
 #include "commit.h"
index 0c3138ede8f7ed0c01d7cc76f6415cd53f631158..d2b8925ebd0fa882fc11b40a9b6fd024468edd77 100644 (file)
@@ -14,6 +14,7 @@
 #include "../object.h"
 #include "../dir.h"
 #include "../chdir-notify.h"
+#include "../setup.h"
 #include "../worktree.h"
 #include "../wrapper.h"
 
index eb382a1e35d4ec3583b39fde33291bad5dfc721d..260ea200bb091f71f1b5d25ee28b17f8042719e7 100644 (file)
@@ -18,6 +18,7 @@
 #include "credential.h"
 #include "oid-array.h"
 #include "send-pack.h"
+#include "setup.h"
 #include "protocol.h"
 #include "quote.h"
 #include "transport.h"
index aeca3ff81363f895fe2fa399fb14c7753ccad538..c29e2f5298194f564a6eb3540a5c0466d9d28348 100644 (file)
--- a/remote.c
+++ b/remote.c
@@ -15,6 +15,7 @@
 #include "revision.h"
 #include "dir.h"
 #include "tag.h"
+#include "setup.h"
 #include "string-list.h"
 #include "strvec.h"
 #include "commit-reach.h"
index 4412f63322473e3182f7af3422a16bf06b0809fd..f6d9f5db08e0ded1390f1ba0d081585cab6b52a3 100644 (file)
@@ -11,6 +11,7 @@
 #include "object.h"
 #include "lockfile.h"
 #include "remote.h"
+#include "setup.h"
 #include "submodule-config.h"
 #include "sparse-index.h"
 #include "promisor-remote.h"
index 53fdeef0787bde16e472c40928fbbdfaa944af4c..f98691a353138584de27eba84d0883c206fc0a91 100644 (file)
@@ -29,6 +29,7 @@
 #include "bisect.h"
 #include "packfile.h"
 #include "worktree.h"
+#include "setup.h"
 #include "strvec.h"
 #include "commit-reach.h"
 #include "commit-graph.h"
index fe61a3ebdd7834e680c5b184b22d49d5d11c9154..27635658c01c8204c8f53c659da262f858c4e3dd 100644 (file)
--- a/scalar.c
+++ b/scalar.c
@@ -15,6 +15,7 @@
 #include "dir.h"
 #include "packfile.h"
 #include "help.h"
+#include "setup.h"
 
 static void setup_enlistment_directory(int argc, const char **argv,
                                       const char * const *usagestr,
diff --git a/setup.c b/setup.c
index cfdc849a78c601e802ba4a3faddf1a6f6fe921e6..6c5b85e96c1e6bfc5367ec54d068d5d61f329aec 100644 (file)
--- a/setup.c
+++ b/setup.c
@@ -5,6 +5,7 @@
 #include "repository.h"
 #include "config.h"
 #include "dir.h"
+#include "setup.h"
 #include "string-list.h"
 #include "chdir-notify.h"
 #include "promisor-remote.h"
diff --git a/setup.h b/setup.h
new file mode 100644 (file)
index 0000000..4c1ca9d
--- /dev/null
+++ b/setup.h
@@ -0,0 +1,168 @@
+#ifndef SETUP_H
+#define SETUP_H
+
+#include "string-list.h"
+
+int is_inside_git_dir(void);
+int is_inside_work_tree(void);
+int get_common_dir_noenv(struct strbuf *sb, const char *gitdir);
+int get_common_dir(struct strbuf *sb, const char *gitdir);
+
+/*
+ * Return true if the given path is a git directory; note that this _just_
+ * looks at the directory itself. If you want to know whether "foo/.git"
+ * is a repository, you must feed that path, not just "foo".
+ */
+int is_git_directory(const char *path);
+
+/*
+ * Return 1 if the given path is the root of a git repository or
+ * submodule, else 0. Will not return 1 for bare repositories with the
+ * exception of creating a bare repository in "foo/.git" and calling
+ * is_git_repository("foo").
+ *
+ * If we run into read errors, we err on the side of saying "yes, it is",
+ * as we usually consider sub-repos precious, and would prefer to err on the
+ * side of not disrupting or deleting them.
+ */
+int is_nonbare_repository_dir(struct strbuf *path);
+
+#define READ_GITFILE_ERR_STAT_FAILED 1
+#define READ_GITFILE_ERR_NOT_A_FILE 2
+#define READ_GITFILE_ERR_OPEN_FAILED 3
+#define READ_GITFILE_ERR_READ_FAILED 4
+#define READ_GITFILE_ERR_INVALID_FORMAT 5
+#define READ_GITFILE_ERR_NO_PATH 6
+#define READ_GITFILE_ERR_NOT_A_REPO 7
+#define READ_GITFILE_ERR_TOO_LARGE 8
+void read_gitfile_error_die(int error_code, const char *path, const char *dir);
+const char *read_gitfile_gently(const char *path, int *return_error_code);
+#define read_gitfile(path) read_gitfile_gently((path), NULL)
+const char *resolve_gitdir_gently(const char *suspect, int *return_error_code);
+#define resolve_gitdir(path) resolve_gitdir_gently((path), NULL)
+
+void setup_work_tree(void);
+/*
+ * Find the commondir and gitdir of the repository that contains the current
+ * working directory, without changing the working directory or other global
+ * state. The result is appended to commondir and gitdir.  If the discovered
+ * gitdir does not correspond to a worktree, then 'commondir' and 'gitdir' will
+ * both have the same result appended to the buffer.  The return value is
+ * either 0 upon success and non-zero if no repository was found.
+ */
+int discover_git_directory(struct strbuf *commondir,
+                          struct strbuf *gitdir);
+const char *setup_git_directory_gently(int *);
+const char *setup_git_directory(void);
+char *prefix_path(const char *prefix, int len, const char *path);
+char *prefix_path_gently(const char *prefix, int len, int *remaining, const char *path);
+
+int check_filename(const char *prefix, const char *name);
+void verify_filename(const char *prefix,
+                    const char *name,
+                    int diagnose_misspelt_rev);
+void verify_non_filename(const char *prefix, const char *name);
+int path_inside_repo(const char *prefix, const char *path);
+
+void sanitize_stdfds(void);
+int daemonize(void);
+
+/*
+ * GIT_REPO_VERSION is the version we write by default. The
+ * _READ variant is the highest number we know how to
+ * handle.
+ */
+#define GIT_REPO_VERSION 0
+#define GIT_REPO_VERSION_READ 1
+
+/*
+ * You _have_ to initialize a `struct repository_format` using
+ * `= REPOSITORY_FORMAT_INIT` before calling `read_repository_format()`.
+ */
+struct repository_format {
+       int version;
+       int precious_objects;
+       char *partial_clone; /* value of extensions.partialclone */
+       int worktree_config;
+       int is_bare;
+       int hash_algo;
+       int sparse_index;
+       char *work_tree;
+       struct string_list unknown_extensions;
+       struct string_list v1_only_extensions;
+};
+
+/*
+ * Always use this to initialize a `struct repository_format`
+ * to a well-defined, default state before calling
+ * `read_repository()`.
+ */
+#define REPOSITORY_FORMAT_INIT \
+{ \
+       .version = -1, \
+       .is_bare = -1, \
+       .hash_algo = GIT_HASH_SHA1, \
+       .unknown_extensions = STRING_LIST_INIT_DUP, \
+       .v1_only_extensions = STRING_LIST_INIT_DUP, \
+}
+
+/*
+ * Read the repository format characteristics from the config file "path" into
+ * "format" struct. Returns the numeric version. On error, or if no version is
+ * found in the configuration, -1 is returned, format->version is set to -1,
+ * and all other fields in the struct are set to the default configuration
+ * (REPOSITORY_FORMAT_INIT). Always initialize the struct using
+ * REPOSITORY_FORMAT_INIT before calling this function.
+ */
+int read_repository_format(struct repository_format *format, const char *path);
+
+/*
+ * Free the memory held onto by `format`, but not the struct itself.
+ * (No need to use this after `read_repository_format()` fails.)
+ */
+void clear_repository_format(struct repository_format *format);
+
+/*
+ * Verify that the repository described by repository_format is something we
+ * can read. If it is, return 0. Otherwise, return -1, and "err" will describe
+ * any errors encountered.
+ */
+int verify_repository_format(const struct repository_format *format,
+                            struct strbuf *err);
+
+/*
+ * Check the repository format version in the path found in get_git_dir(),
+ * and die if it is a version we don't understand. Generally one would
+ * set_git_dir() before calling this, and use it only for "are we in a valid
+ * repo?".
+ *
+ * If successful and fmt is not NULL, fill fmt with data.
+ */
+void check_repository_format(struct repository_format *fmt);
+
+/*
+ * NOTE NOTE NOTE!!
+ *
+ * PERM_UMASK, OLD_PERM_GROUP and OLD_PERM_EVERYBODY enumerations must
+ * not be changed. Old repositories have core.sharedrepository written in
+ * numeric format, and therefore these values are preserved for compatibility
+ * reasons.
+ */
+enum sharedrepo {
+       PERM_UMASK          = 0,
+       OLD_PERM_GROUP      = 1,
+       OLD_PERM_EVERYBODY  = 2,
+       PERM_GROUP          = 0660,
+       PERM_EVERYBODY      = 0664
+};
+int git_config_perm(const char *var, const char *value);
+
+struct startup_info {
+       int have_repository;
+       const char *prefix;
+       const char *original_cwd;
+};
+extern struct startup_info *startup_info;
+extern const char *tmp_original_cwd;
+
+#endif /* SETUP_H */
index acf030b95e4c47a1df065e775fd936c5059bf44a..75e0d45cbcbfe1726281a2b0f200401800d23491 100644 (file)
@@ -26,6 +26,7 @@
 #include "parse-options.h"
 #include "object-store.h"
 #include "commit-reach.h"
+#include "setup.h"
 #include "shallow.h"
 
 static int config_update_recurse_submodules = RECURSE_SUBMODULES_OFF;
index c35c8d4408d41f5872913388fe5de78f009ed801..27ecc93693b035179bf5cd1d53a5852480f93b39 100644 (file)
@@ -1,5 +1,6 @@
 #include "cache.h"
 #include "gettext.h"
+#include "setup.h"
 
 static int threaded_check_leading_path(struct cache_def *cache, const char *name,
                                       int len, int warn_on_lstat_err);
index cb881139f7316f475ea072c1b549aafe7cca2ad1..4e6ed30afa1273f25aeca0a37b633bccca6a569c 100644 (file)
@@ -2,6 +2,7 @@
 #include "cache.h"
 #include "advice.h"
 #include "config.h"
+#include "setup.h"
 
 int cmd__advise_if_enabled(int argc, const char **argv)
 {
index 5bb489882dab27c21d412c8a5238a8b24bc08a09..af43ee1cb5ee27c6aad608c7a233e234a7146f89 100644 (file)
@@ -1,6 +1,7 @@
 #include "test-tool.h"
 #include "git-compat-util.h"
 #include "pack-bitmap.h"
+#include "setup.h"
 
 static int bitmap_list_commits(void)
 {
index 127f134a2a6e4709b4bed08419b88961354a05e7..e5754b8da625f6231b0c70d73a0c5b05147a5a8c 100644 (file)
@@ -3,6 +3,7 @@
 #include "hex.h"
 #include "test-tool.h"
 #include "commit.h"
+#include "setup.h"
 
 static struct bloom_filter_settings settings = DEFAULT_BLOOM_FILTER_SETTINGS;
 
index 8b7a8fce1eeba878ecc4940f3e7c8eb463fbab35..cdaf5046f5aa1adeee936c13f7129146dfefe355 100644 (file)
@@ -6,6 +6,7 @@
 #include "tree.h"
 #include "cache-tree.h"
 #include "parse-options.h"
+#include "setup.h"
 
 static char const * const test_cache_tree_usage[] = {
        N_("test-tool cache-tree <options> (control|prime|update)"),
index 4ba9eb65606d42f70f345a1b18bcd575db31e4cf..5877188f3ad13c3890863504856bcae37b29650e 100644 (file)
@@ -1,6 +1,7 @@
 #include "test-tool.h"
 #include "cache.h"
 #include "config.h"
+#include "setup.h"
 #include "string-list.h"
 
 /*
index 92dfc1aa8c4a9e37e4c26c419ea8fcf640399182..715aabfbae7a74ab56650dc358a2e9e4270d1512 100644 (file)
@@ -4,7 +4,7 @@
 #include "hex.h"
 #include "tree.h"
 #include "cache-tree.h"
-
+#include "setup.h"
 
 static void dump_one(struct cache_tree *it, const char *pfx, const char *x)
 {
index 975f0ac8905125f01ce37be5b7bc862cf058fbcf..7e9de296db362ebec94e6642894444d75698ec38 100644 (file)
@@ -1,5 +1,6 @@
 #include "test-tool.h"
 #include "cache.h"
+#include "setup.h"
 
 int cmd__dump_fsmonitor(int ac, const char **av)
 {
index 813d0a38fae206587438c609cf0282f9f3c6a6aa..289a01c10acbed2508b1437cd3ffa841574d4376 100644 (file)
@@ -2,6 +2,7 @@
 #include "test-tool.h"
 #include "cache.h"
 #include "hex.h"
+#include "setup.h"
 #include "split-index.h"
 #include "ewah/ewok.h"
 
index af953fabe871cc1bc0d4a3999942a9113a6f1f2a..415f55f31dadae5b0d5abfb21a2ad5acd6467d8c 100644 (file)
@@ -3,6 +3,7 @@
 #include "cache.h"
 #include "dir.h"
 #include "hex.h"
+#include "setup.h"
 
 static int compare_untracked(const void *a_, const void *b_)
 {
index 627a6bdc3d0f64a48cb640483f95e57b54ef217a..e402c35a7022372afed415d4f74099c889abfa25 100644 (file)
@@ -23,6 +23,7 @@
 #include "refs.h"
 #include "revision.h"
 #include "sequencer.h"
+#include "setup.h"
 #include "strvec.h"
 #include "tree.h"
 
index c43fc976b82368b8adb0d8aecfaf4d97b816baf6..a37236cd0a678d544c9bcb41dfbbe4ced2924313 100644 (file)
@@ -7,6 +7,7 @@
 #include "cache.h"
 #include "parse-options.h"
 #include "fsmonitor-ipc.h"
+#include "setup.h"
 #include "thread-utils.h"
 #include "trace2.h"
 #include "wrapper.h"
index 2b678a4579398e5502e1367d999f72b3214e2238..06ce3a47ccfbfd3e33bb6bbacf796253c3da365f 100644 (file)
@@ -3,6 +3,7 @@
 #include "cache.h"
 #include "environment.h"
 #include "parse-options.h"
+#include "setup.h"
 
 static int single;
 static int multi;
index 04bc2563f3e5b96fcd12867f7b5743571046971e..64705734dfec9e823416f2bb449b94d14d45495f 100644 (file)
@@ -1,6 +1,7 @@
 #include "test-tool.h"
 #include "cache.h"
 #include "hex.h"
+#include "setup.h"
 #include "tree.h"
 
 int cmd__match_trees(int ac, const char **av)
index 0906993ad59bfcd0a4f3e20f8c1a1a0bff737a59..fd6f73ea03ba46a5d2005ca19aab352e9b4b9f99 100644 (file)
@@ -2,6 +2,7 @@
 #include "cache.h"
 #include "hex.h"
 #include "oid-array.h"
+#include "setup.h"
 
 static int print_oid(const struct object_id *oid, void *data)
 {
index 883d40efd45edc16fe486d2ad5228590451b8071..f1b3dbe376b94250080faa47c37867208e21ed71 100644 (file)
@@ -2,6 +2,7 @@
 #include "cache.h"
 #include "hex.h"
 #include "oidmap.h"
+#include "setup.h"
 #include "strbuf.h"
 
 /* key is an oid and value is a name (could be a refname for example) */
index 0b82431a70fe99cb59e1729fae49eacd4920878e..edcb7e9f44864d33b2baff3ea0d4879b26969d6a 100644 (file)
@@ -2,6 +2,7 @@
 #include "cache.h"
 #include "hex.h"
 #include "oidtree.h"
+#include "setup.h"
 
 static enum cb_next print_oid(const struct object_id *oid, void *data)
 {
index 0e53dee9e57a1e29c38958334941eefb1cead288..75ca1505a37c0cc8f02f2dbd86521fbd81454db9 100644 (file)
@@ -5,6 +5,7 @@
 #include "object-store.h"
 #include "packfile.h"
 #include "pack-mtimes.h"
+#include "setup.h"
 
 static void dump_mtimes(struct packed_git *p)
 {
index da17fd37eb1dc487eb12b1ca9aab3a443c2599fb..cce496944ac002c0371463a4e9b4b8303f6a7083 100644 (file)
@@ -3,6 +3,7 @@
 #include "test-tool.h"
 #include "repository.h"
 #include "object-store.h"
+#include "setup.h"
 
 /*
  * Prints the size of the object corresponding to the given hash in a specific
index cc266e3ec096bb740da9f327ff1a6ef369a727c5..4f5ac2fadce3d940241c7f8b3fc529bc3318ec71 100644 (file)
@@ -2,6 +2,7 @@
 #include "cache.h"
 #include "abspath.h"
 #include "environment.h"
+#include "setup.h"
 #include "string-list.h"
 #include "utf8.h"
 
index 7e12d4f9aa2d00f2dbb8a46d8795bced622d4794..7c8de7b562a9d1dedfbfebb4032276a841d555cc 100644 (file)
@@ -3,6 +3,7 @@
 #include "hex.h"
 #include "parse-options.h"
 #include "pkt-line.h"
+#include "setup.h"
 #include "sigchain.h"
 #include "test-tool.h"
 
index 09c711038ce18accb1235cac3b56db8c99bc6a6c..91bb2dec1df2dd4fb7ee44fa149cd8eb14d175b4 100644 (file)
@@ -8,6 +8,7 @@
 #include "hex.h"
 #include "parse-options.h"
 #include "ref-filter.h"
+#include "setup.h"
 #include "string-list.h"
 #include "tag.h"
 
index 84818363d5b24e65a2241830dcf342deb524b0c2..a4c24d0e4215f6bec167b61125bc8629bbc774a0 100644 (file)
@@ -2,6 +2,7 @@
 #include "test-tool.h"
 #include "cache.h"
 #include "config.h"
+#include "setup.h"
 #include "wrapper.h"
 
 int cmd__read_cache(int argc, const char **argv)
index 98b73bb8f25aabea7384cde0fb639cff16cf631e..e21b0805f3c6f0e7572d915d6ce62add6d2b27fc 100644 (file)
@@ -4,6 +4,7 @@
 #include "repository.h"
 #include "object-store.h"
 #include "bloom.h"
+#include "setup.h"
 
 int cmd__read_graph(int argc, const char **argv)
 {
index 0a883cdf26b0871657e6dc3c778ae2ca9f323cef..05c4f2b2625b8b634e859ff975de99621ec92026 100644 (file)
@@ -5,6 +5,7 @@
 #include "repository.h"
 #include "object-store.h"
 #include "pack-bitmap.h"
+#include "setup.h"
 
 static int read_midx_file(const char *object_dir, int show_objects)
 {
index 1745b088b7c2b924b006bf90e02ae4677b0cc30d..8717b95e84fd85d9883f0e0031bc9aa625710f64 100644 (file)
@@ -2,6 +2,7 @@
 #include "cache.h"
 #include "hex.h"
 #include "refs.h"
+#include "setup.h"
 #include "worktree.h"
 #include "object-store.h"
 #include "repository.h"
index c444775eb0f46cabd2bea37f60d529d22395c59c..6774f6245f0f29de1a59f3d9f9660006d547824c 100644 (file)
@@ -8,6 +8,7 @@
 #include "object-store.h"
 #include "object.h"
 #include "repository.h"
+#include "setup.h"
 #include "tree.h"
 
 static void test_parse_commit_in_graph(const char *gitdir, const char *worktree,
index 4a45d5bac2af5678eda5ad8b49c7747a3973878e..f2df4334063f62199b6e7855495c1e0871ee029e 100644 (file)
@@ -13,6 +13,7 @@
 #include "commit.h"
 #include "diff.h"
 #include "revision.h"
+#include "setup.h"
 
 static void print_commit(struct commit *commit)
 {
index a26107ed70ac023da79a573bf0d87cdad95016d0..15b7688774c25add02b81acd5fbe38abc1287379 100644 (file)
@@ -2,6 +2,7 @@
 #include "test-tool.h"
 #include "cache.h"
 #include "lockfile.h"
+#include "setup.h"
 #include "tree.h"
 #include "cache-tree.h"
 
index 497d72058de839af7608177a355c32b7c55a56fb..7d590ab72276efe914b3e0376b38815cfa3f3795 100644 (file)
@@ -3,6 +3,7 @@
 #include "gettext.h"
 #include "parse-options.h"
 #include "serve.h"
+#include "setup.h"
 
 static char const * const serve_usage[] = {
        N_("test-tool serve-v2 [<options>]"),
index 22a41c409263c077843598e4cc51881a52b0ce30..256bfa6e9e15745c5851111d71f2b925b989a81c 100644 (file)
@@ -1,6 +1,7 @@
 #include "test-tool.h"
 #include "cache.h"
 #include "config.h"
+#include "setup.h"
 #include "submodule-config.h"
 #include "submodule.h"
 
index a3848a8b66859e58c3d43065208a4292e63fabec..aaffd422d6e09a638b7515de0b2c9dc51939e286 100644 (file)
@@ -1,5 +1,6 @@
 #include "test-tool.h"
 #include "cache.h"
+#include "setup.h"
 #include "submodule-config.h"
 
 static void die_usage(const char **argv, const char *msg)
index e060cc6226895d750ced2cab19cedb46f97843b9..f18ca46dce40b720e12cc76e6360db1537feed1e 100644 (file)
@@ -3,6 +3,7 @@
 #include "cache.h"
 #include "parse-options.h"
 #include "remote.h"
+#include "setup.h"
 #include "submodule-config.h"
 #include "submodule.h"
 
index ff22f2fa2c57efbda1246f1aab0da494eb026fd1..65a355cc590a1143d1ba7064d2c87d7fcb8d9056 100644 (file)
@@ -1,6 +1,7 @@
 #include "test-tool.h"
 #include "cache.h"
 #include "run-command.h"
+#include "setup.h"
 
 int cmd__subprocess(int argc, const char **argv)
 {
index a2b56b9cae5e3736220afcc30919d1c8bca0b69a..0cd7ee12b7e51b1e3817114a5fe488cab4172f5c 100644 (file)
@@ -1,5 +1,6 @@
 #include "test-tool.h"
 #include "cache.h"
+#include "setup.h"
 #include "userdiff.h"
 #include "config.h"
 
index 7d45cd61e820305615f4c53157e39074adcb0a50..a93417ed3a97c8a027e49dd6e2b6851295227dd0 100644 (file)
@@ -2,6 +2,7 @@
 #include "test-tool.h"
 #include "cache.h"
 #include "lockfile.h"
+#include "setup.h"
 
 int cmd__write_cache(int argc, const char **argv)
 {
diff --git a/trace.c b/trace.c
index 9c85b71ec6a241be2ac8cd8dbf1995eba7363d26..81318a2455df4c9c3c0725bdd31314788cee4a17 100644 (file)
--- a/trace.c
+++ b/trace.c
@@ -25,6 +25,7 @@
 #include "abspath.h"
 #include "environment.h"
 #include "quote.h"
+#include "setup.h"
 #include "wrapper.h"
 
 struct trace_key trace_default_key = { "GIT_TRACE", 0, 0, 0 };
index 0ff4bbc6b96f46492c506bfec6cbc840656edc13..a26fda3493f699f52df1c60e15870084b8a6174f 100644 (file)
@@ -22,6 +22,7 @@
 #include "promisor-remote.h"
 #include "entry.h"
 #include "parallel-checkout.h"
+#include "setup.h"
 
 /*
  * Error messages expected by scripts out of plumbing commands such as
index c2671b0cdf38cb68c41fec5972897d4933e97dbb..7f0f04eab56a3bfb9257d3dc3d31d3948658e3a0 100644 (file)
@@ -5,6 +5,7 @@
 #include "gettext.h"
 #include "repository.h"
 #include "refs.h"
+#include "setup.h"
 #include "strbuf.h"
 #include "worktree.h"
 #include "dir.h"
index 106e46480a177d23cdd8be2e81e9e527cca78400..16e0df5736f7e95b3fb73a7283c0263358e1c6f1 100644 (file)
@@ -16,6 +16,7 @@
 #include "refs.h"
 #include "submodule.h"
 #include "column.h"
+#include "setup.h"
 #include "strbuf.h"
 #include "utf8.h"
 #include "worktree.h"