]> git.ipfire.org Git - thirdparty/git.git/commitdiff
global: introduce `USE_THE_REPOSITORY_VARIABLE` macro
authorPatrick Steinhardt <ps@pks.im>
Fri, 14 Jun 2024 06:50:23 +0000 (08:50 +0200)
committerJunio C Hamano <gitster@pobox.com>
Fri, 14 Jun 2024 17:26:33 +0000 (10:26 -0700)
Use of the `the_repository` variable is deprecated nowadays, and we
slowly but steadily convert the codebase to not use it anymore. Instead,
callers should be passing down the repository to work on via parameters.

It is hard though to prove that a given code unit does not use this
variable anymore. The most trivial case, merely demonstrating that there
is no direct use of `the_repository`, is already a bit of a pain during
code reviews as the reviewer needs to manually verify claims made by the
patch author. The bigger problem though is that we have many interfaces
that implicitly rely on `the_repository`.

Introduce a new `USE_THE_REPOSITORY_VARIABLE` macro that allows code
units to opt into usage of `the_repository`. The intent of this macro is
to demonstrate that a certain code unit does not use this variable
anymore, and to keep it from new dependencies on it in future changes,
be it explicit or implicit

For now, the macro only guards `the_repository` itself as well as
`the_hash_algo`. There are many more known interfaces where we have an
implicit dependency on `the_repository`, but those are not guarded at
the current point in time. Over time though, we should start to add
guards as required (or even better, just remove them).

Define the macro as required in our code units. As expected, most of our
code still relies on the global variable. Nearly all of our builtins
rely on the variable as there is no way yet to pass `the_repository` to
their entry point. For now, declare the macro in "biultin.h" to keep the
required changes at least a little bit more contained.

Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
160 files changed:
add-interactive.c
add-patch.c
apply.c
archive-tar.c
archive-zip.c
archive.c
attr.c
bisect.c
blame.c
branch.c
builtin.h
builtin/blame.c
builtin/log.c
bulk-checkin.c
bundle-uri.c
bundle.c
cache-tree.c
checkout.c
chunk-format.c
combine-diff.c
commit-graph.c
commit-reach.c
commit.c
common-main.c
compat/win32/trace2_win32_process_info.c
config.c
connected.c
convert.c
csum-file.c
delta-islands.c
diagnose.c
diff-lib.c
diff.c
diffcore-break.c
diffcore-rename.c
dir.c
entry.c
environment.c
fetch-pack.c
fmt-merge-msg.c
fsck.c
fsmonitor-ipc.c
git.c
hash-lookup.c
hash.h
help.c
hex.c
http-backend.c
http-push.c
http-walker.c
http.c
list-objects-filter-options.c
list-objects-filter.c
list-objects.c
log-tree.c
loose.c
ls-refs.c
mailmap.c
match-trees.c
merge-blobs.c
merge-ort.c
merge-recursive.c
merge.c
midx-write.c
midx.c
negotiator/default.c
negotiator/skipping.c
notes-cache.c
notes-merge.c
notes-utils.c
notes.c
object-file-convert.c
object-file.c
object-name.c
object.c
oid-array.c
oss-fuzz/fuzz-commit-graph.c
pack-bitmap-write.c
pack-bitmap.c
pack-check.c
pack-revindex.c
pack-write.c
packfile.c
parse-options-cb.c
path.c
pathspec.c
pretty.c
progress.c
promisor-remote.c
range-diff.c
reachable.c
read-cache.c
rebase-interactive.c
ref-filter.c
reflog-walk.c
reflog.c
refs.c
refs/files-backend.c
refs/packed-backend.c
refs/reftable-backend.c
refspec.c
remote-curl.c
remote.c
repository.c
repository.h
rerere.c
reset.c
resolve-undo.c
revision.c
run-command.c
scalar.c
send-pack.c
sequencer.c
serve.c
server-info.c
setup.c
shallow.c
split-index.c
streaming.c
submodule-config.c
submodule.c
t/helper/test-bitmap.c
t/helper/test-bloom.c
t/helper/test-cache-tree.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-find-pack.c
t/helper/test-fsmonitor-client.c
t/helper/test-lazy-init-name-hash.c
t/helper/test-match-trees.c
t/helper/test-oidmap.c
t/helper/test-pack-mtimes.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-submodule-config.c
t/helper/test-submodule-nested-repo-config.c
t/helper/test-submodule.c
t/helper/test-trace2.c
t/helper/test-write-cache.c
t/unit-tests/t-example-decorate.c
tag.c
tmp-objdir.c
transport-helper.c
transport.c
tree-walk.c
tree.c
unpack-trees.c
upload-pack.c
walker.c
worktree.c
wt-status.c
xdiff-interface.c

index a0961096cd15098682ccb26c28f1725e3c20e5c7..49042b30261cc507d1094a007617764c1266eaed 100644 (file)
@@ -1,3 +1,5 @@
+#define USE_THE_REPOSITORY_VARIABLE
+
 #include "git-compat-util.h"
 #include "add-interactive.h"
 #include "color.h"
index 86181770f2c0bd7d76e52159a20e83d267eee72b..99e037c1e21cf026b943fae531159fb9430ab620 100644 (file)
@@ -1,3 +1,5 @@
+#define USE_THE_REPOSITORY_VARIABLE
+
 #include "git-compat-util.h"
 #include "add-interactive.h"
 #include "advice.h"
diff --git a/apply.c b/apply.c
index 528939abb6d6054495cc7ad5c75a2bc39772feb2..ff939f908add9e359e7aee268b7791920670f51f 100644 (file)
--- a/apply.c
+++ b/apply.c
@@ -7,6 +7,8 @@
  *
  */
 
+#define USE_THE_REPOSITORY_VARIABLE
+
 #include "git-compat-util.h"
 #include "abspath.h"
 #include "base85.h"
index 8ae30125f84c463118d70b69eae88d4d21d31905..e7b3489e1e6c826d8128cddb0c5be04042a65cec 100644 (file)
@@ -1,6 +1,9 @@
 /*
  * Copyright (c) 2005, 2006 Rene Scharfe
  */
+
+#define USE_THE_REPOSITORY_VARIABLE
+
 #include "git-compat-util.h"
 #include "config.h"
 #include "gettext.h"
index fd1d3f816d30d696456cf1915bb40f2d325f3010..9f32730181bf62d83bc6f4bcb7fe06d48accc9c3 100644 (file)
@@ -1,6 +1,9 @@
 /*
  * Copyright (c) 2006 Rene Scharfe
  */
+
+#define USE_THE_REPOSITORY_VARIABLE
+
 #include "git-compat-util.h"
 #include "config.h"
 #include "archive.h"
index 5287fcdd8e0460063f40e4e3f7a812d248e41afd..7bd60d0632a41c7cd029497185ca75e93570ccba 100644 (file)
--- a/archive.c
+++ b/archive.c
@@ -1,3 +1,5 @@
+#define USE_THE_REPOSITORY_VARIABLE
+
 #include "git-compat-util.h"
 #include "abspath.h"
 #include "config.h"
diff --git a/attr.c b/attr.c
index 300f994ba6e283077564cf1372387c943155fadd..b5ed83c90ec7f4ba370d4369bd1de01db2c2c0ff 100644 (file)
--- a/attr.c
+++ b/attr.c
@@ -6,6 +6,8 @@
  * an insanely large number of attributes.
  */
 
+#define USE_THE_REPOSITORY_VARIABLE
+
 #include "git-compat-util.h"
 #include "config.h"
 #include "environment.h"
index 4ea703bec116da8997061b56eb263e79362c20d7..135f94ba097ae07b5984d820e02eb50400271024 100644 (file)
--- a/bisect.c
+++ b/bisect.c
@@ -1,3 +1,5 @@
+#define USE_THE_REPOSITORY_VARIABLE
+
 #include "git-compat-util.h"
 #include "config.h"
 #include "commit.h"
diff --git a/blame.c b/blame.c
index a80f5e2e61f57cb7ce09c10c40728fe8fb3332cb..d403c46a35af447e9ac194c23c0dd386766175a9 100644 (file)
--- a/blame.c
+++ b/blame.c
@@ -1,3 +1,5 @@
+#define USE_THE_REPOSITORY_VARIABLE
+
 #include "git-compat-util.h"
 #include "refs.h"
 #include "object-store-ll.h"
index df5d24fec6d909b2ceb78862e03907318a2cd315..c887ea215147ce530cc4104bd61bd883367e7e17 100644 (file)
--- a/branch.c
+++ b/branch.c
@@ -1,3 +1,5 @@
+#define USE_THE_REPOSITORY_VARIABLE
+
 #include "git-compat-util.h"
 #include "advice.h"
 #include "config.h"
index 7eda9b248639ff0212c5e6ad28a17fbe06e575ca..14fa0171607b176639efa01cf5f720b4a4f8ad09 100644 (file)
--- a/builtin.h
+++ b/builtin.h
@@ -1,6 +1,14 @@
 #ifndef BUILTIN_H
 #define BUILTIN_H
 
+/*
+ * TODO: Almost all of our builtins access `the_repository` by necessity
+ * because they do not get passed a pointer to it. We should adapt the function
+ * signature of those main functions to accept a `struct repository *` and then
+ * remove the macro here.
+ */
+#define USE_THE_REPOSITORY_VARIABLE
+
 #include "git-compat-util.h"
 
 /*
index e09ff0155a54e4ed8dbad76e73dfa7a367ae1c73..de89fff3f80bc35a031b76a36327050ef37cf7dc 100644 (file)
@@ -5,7 +5,7 @@
  * See COPYING for licensing conditions
  */
 
-#include "git-compat-util.h"
+#include "builtin.h"
 #include "config.h"
 #include "color.h"
 #include "builtin.h"
index ccbda8a0052e555da1a712cee31628918e7cff47..00305bea5114185e28cddde6c6b87f8b0e66c83f 100644 (file)
@@ -4,7 +4,7 @@
  * (C) Copyright 2006 Linus Torvalds
  *              2006 Junio Hamano
  */
-#include "git-compat-util.h"
+#include "builtin.h"
 #include "abspath.h"
 #include "config.h"
 #include "environment.h"
index eb46b8863793e25b82ca6df27eb435476c4807a5..da8673199b28f5641181432d890e5b331bebdd67 100644 (file)
@@ -1,6 +1,9 @@
 /*
  * Copyright (c) 2011, Google Inc.
  */
+
+#define USE_THE_REPOSITORY_VARIABLE
+
 #include "git-compat-util.h"
 #include "bulk-checkin.h"
 #include "environment.h"
index 91b3319a5c18443c93010496459c4b6630b2bcaf..804fbcfbfaf284daf0a4a476463440c83234ba09 100644 (file)
@@ -1,3 +1,5 @@
+#define USE_THE_REPOSITORY_VARIABLE
+
 #include "git-compat-util.h"
 #include "bundle-uri.h"
 #include "bundle.h"
index 95367c2d0a06dd69cc36114ebae5a28aab8a9700..82c285b905ab9eb477aa67d2c3b60d3d55843f0d 100644 (file)
--- a/bundle.c
+++ b/bundle.c
@@ -1,3 +1,5 @@
+#define USE_THE_REPOSITORY_VARIABLE
+
 #include "git-compat-util.h"
 #include "lockfile.h"
 #include "bundle.h"
index 3290a1b8dd784b44c0a282d16782e6908524faee..50610c3f3cb8e7d3c7b84a513286590201d6f99a 100644 (file)
@@ -1,3 +1,5 @@
+#define USE_THE_REPOSITORY_VARIABLE
+
 #include "git-compat-util.h"
 #include "environment.h"
 #include "hex.h"
index cfaea4bd10b215293cf0f1033cd7be5ba392c577..0b1cf8b40b78464e5c0381f13c563ae710c2f424 100644 (file)
@@ -1,3 +1,5 @@
+#define USE_THE_REPOSITORY_VARIABLE
+
 #include "git-compat-util.h"
 #include "object-name.h"
 #include "remote.h"
index cdc7f39b7039b94a14a42ec74b0e27917c43fe4f..2dde24e6a317ce82ac23f8ba8d1c9da6315bfca0 100644 (file)
@@ -1,3 +1,5 @@
+#define USE_THE_REPOSITORY_VARIABLE
+
 #include "git-compat-util.h"
 #include "chunk-format.h"
 #include "csum-file.h"
index 4960d904ac658f217cdfebc4347a8920b032d6f7..829a44e4167300c2ea7a89fbeda85f405264b1ed 100644 (file)
@@ -1,3 +1,5 @@
+#define USE_THE_REPOSITORY_VARIABLE
+
 #include "git-compat-util.h"
 #include "object-store-ll.h"
 #include "commit.h"
index 98cbd53eeac5c67fbce0e70ee0c486046b4c997c..e1070ee6e7f9fd96807d41f4f114eaeab3c31ba9 100644 (file)
@@ -1,3 +1,5 @@
+#define USE_THE_REPOSITORY_VARIABLE
+
 #include "git-compat-util.h"
 #include "config.h"
 #include "csum-file.h"
index 384aee1ab3a3d9029e7d7281ccbd7515a5b7f2f7..dabc2972e423bcf5899fc31935d39a599ffec9aa 100644 (file)
@@ -1,3 +1,5 @@
+#define USE_THE_REPOSITORY_VARIABLE
+
 #include "git-compat-util.h"
 #include "commit.h"
 #include "commit-graph.h"
index 1d08951007bcd9c3722737ef7b4b6ba3ada2f5f5..4956803e11da979cf38c706c40ad7df1914e60d5 100644 (file)
--- a/commit.c
+++ b/commit.c
@@ -1,3 +1,5 @@
+#define USE_THE_REPOSITORY_VARIABLE
+
 #include "git-compat-util.h"
 #include "tag.h"
 #include "commit.h"
index b86f40600f7acbb1d552941a94217d63c2ab78a5..8e68ac9e42993dcbc1ed00ad04318fa0b642b812 100644 (file)
@@ -1,3 +1,5 @@
+#define USE_THE_REPOSITORY_VARIABLE
+
 #include "git-compat-util.h"
 #include "exec-cmd.h"
 #include "gettext.h"
index 3ef0936f6ff9711caed8c22c8aebd92eb4be6e30..f147da706a240e0a39f53f717e27b0fe594fb555 100644 (file)
@@ -1,3 +1,5 @@
+#define USE_THE_REPOSITORY_VARIABLE
+
 #include "../../git-compat-util.h"
 #include "../../json-writer.h"
 #include "../../repository.h"
index abce05b7744a91477a6d11c43501e02e6bf4c734..7951029644836c09bdf704577b60b0054d686d7b 100644 (file)
--- a/config.c
+++ b/config.c
@@ -5,6 +5,9 @@
  * Copyright (C) Johannes Schindelin, 2005
  *
  */
+
+#define USE_THE_REPOSITORY_VARIABLE
+
 #include "git-compat-util.h"
 #include "abspath.h"
 #include "advice.h"
index 8f89376dbcf30cd2cf69c3d2eaa446e47c9f4ae8..87cc4b57a17ce541b044950f937a11bfe39707ec 100644 (file)
@@ -1,3 +1,5 @@
+#define USE_THE_REPOSITORY_VARIABLE
+
 #include "git-compat-util.h"
 #include "gettext.h"
 #include "hex.h"
index f2b9f01354d0d76e3e2bf117dc3a1e80d280635e..d8737fe0f2d60ff372140194bc88e6a1999450e4 100644 (file)
--- a/convert.c
+++ b/convert.c
@@ -1,3 +1,5 @@
+#define USE_THE_REPOSITORY_VARIABLE
+
 #include "git-compat-util.h"
 #include "advice.h"
 #include "config.h"
index f4be0804b716dbf110d4862a8ffac4d51e745762..8abbf013250eef0d5bc33cf2f47ce6797c51e0bb 100644 (file)
@@ -7,6 +7,9 @@
  * files. Useful when you write a file that you want to be
  * able to verify hasn't been messed with afterwards.
  */
+
+#define USE_THE_REPOSITORY_VARIABLE
+
 #include "git-compat-util.h"
 #include "progress.h"
 #include "csum-file.h"
index 89d51b72e39cff16f13d54c04a1746c169b56129..ffe1ca28144fead287ecb639378a351a30b6027a 100644 (file)
@@ -1,3 +1,5 @@
+#define USE_THE_REPOSITORY_VARIABLE
+
 #include "git-compat-util.h"
 #include "object.h"
 #include "commit.h"
index 4d096c857f1e669a44bc2e43375889ce2952083c..cc2d535b60d7c886640f458f062cf5720f9cf36b 100644 (file)
@@ -1,3 +1,5 @@
+#define USE_THE_REPOSITORY_VARIABLE
+
 #include "git-compat-util.h"
 #include "diagnose.h"
 #include "compat/disk.h"
index 3fb8d79fefd6db1ce1f26be56bb83d1d2e73cd4d..b0d0f711e88491567b20b918bf57c2149e49fdf0 100644 (file)
@@ -1,6 +1,9 @@
 /*
  * Copyright (C) 2005 Junio C Hamano
  */
+
+#define USE_THE_REPOSITORY_VARIABLE
+
 #include "git-compat-util.h"
 #include "commit.h"
 #include "diff.h"
diff --git a/diff.c b/diff.c
index 60d1f7be81d9c65bcbddbae478c49dcecdf16898..d4579d5f76e1164bb2716c5801efe786edaa6080 100644 (file)
--- a/diff.c
+++ b/diff.c
@@ -1,6 +1,9 @@
 /*
  * Copyright (C) 2005 Junio C Hamano
  */
+
+#define USE_THE_REPOSITORY_VARIABLE
+
 #include "git-compat-util.h"
 #include "abspath.h"
 #include "base85.h"
index 49ba38aa7c0a58433380e560f6d84e0cc084a67f..831b66b5c3e85c03f35aed8546ee1dfb62524afd 100644 (file)
@@ -1,6 +1,9 @@
 /*
  * Copyright (C) 2005 Junio C Hamano
  */
+
+#define USE_THE_REPOSITORY_VARIABLE
+
 #include "git-compat-util.h"
 #include "diffcore.h"
 #include "hash.h"
index 5abb9586516af9ad46180985f8a6c81985f900cb..ae504007cfa6f7748f6a37d5aea282b1ae471f8a 100644 (file)
@@ -2,6 +2,9 @@
  *
  * Copyright (C) 2005 Junio C Hamano
  */
+
+#define USE_THE_REPOSITORY_VARIABLE
+
 #include "git-compat-util.h"
 #include "diff.h"
 #include "diffcore.h"
diff --git a/dir.c b/dir.c
index 5de421c29c72ead667f43ae6820dbcaf3fc1de9d..b7a6625ebda526bf4ba7d3397fbf09feb27ec94e 100644 (file)
--- a/dir.c
+++ b/dir.c
@@ -5,6 +5,9 @@
  * Copyright (C) Linus Torvalds, 2005-2006
  *              Junio Hamano, 2005-2006
  */
+
+#define USE_THE_REPOSITORY_VARIABLE
+
 #include "git-compat-util.h"
 #include "abspath.h"
 #include "config.h"
diff --git a/entry.c b/entry.c
index b8c257f6f9f2d88a69e1fe46e88d7b18ca85bd5f..fe1f74d140e3ed27bda7c714e16561fd6de410dc 100644 (file)
--- a/entry.c
+++ b/entry.c
@@ -1,3 +1,5 @@
+#define USE_THE_REPOSITORY_VARIABLE
+
 #include "git-compat-util.h"
 #include "object-store-ll.h"
 #include "dir.h"
index 701d51513545f986fcd1537fdf0881191afc6992..5cea2c9f5473e3a0739c8cf3b259c1bead877331 100644 (file)
@@ -7,6 +7,9 @@
  * even if you might want to know where the git directory etc
  * are.
  */
+
+#define USE_THE_REPOSITORY_VARIABLE
+
 #include "git-compat-util.h"
 #include "abspath.h"
 #include "branch.h"
index eba9e420ea69b8bbebe2c53127a48950e1008dab..e6e14b3874ae6986219469c9eeb242b4551faed1 100644 (file)
@@ -1,3 +1,5 @@
+#define USE_THE_REPOSITORY_VARIABLE
+
 #include "git-compat-util.h"
 #include "repository.h"
 #include "config.h"
index 7d144b803aef0653ff80ed58ab8607713dbc6726..b8bca89c0cb9d2a7cea5420bd05a3e5820f64fba 100644 (file)
@@ -1,3 +1,5 @@
+#define USE_THE_REPOSITORY_VARIABLE
+
 #include "git-compat-util.h"
 #include "config.h"
 #include "environment.h"
diff --git a/fsck.c b/fsck.c
index dd0a33028ee098ea601a407fc6df0c22e4661e7a..432996cbb6c5f19c4efd1e33eb2c6774f3dce73e 100644 (file)
--- a/fsck.c
+++ b/fsck.c
@@ -1,3 +1,5 @@
+#define USE_THE_REPOSITORY_VARIABLE
+
 #include "git-compat-util.h"
 #include "date.h"
 #include "dir.h"
index 45471b5b741a19515b5d0caea2dd01dd3e9fce25..f1b163111194fb7c528e733366da7c280ce36456 100644 (file)
@@ -1,3 +1,5 @@
+#define USE_THE_REPOSITORY_VARIABLE
+
 #include "git-compat-util.h"
 #include "gettext.h"
 #include "simple-ipc.h"
diff --git a/git.c b/git.c
index 683bb69194fd5d5769f85f06c1c386e32e791a88..e35af9b0e5e976d43abbc490234d033b42542530 100644 (file)
--- a/git.c
+++ b/git.c
@@ -1,3 +1,5 @@
+#define USE_THE_REPOSITORY_VARIABLE
+
 #include "builtin.h"
 #include "config.h"
 #include "environment.h"
index 9aa6b82eb73a3d3e642987f644bb7fd74d88e97f..5f808caa51ee899aced42fe0c50118de2010fb65 100644 (file)
@@ -1,3 +1,5 @@
+#define USE_THE_REPOSITORY_VARIABLE
+
 #include "git-compat-util.h"
 #include "hash.h"
 #include "hash-lookup.h"
diff --git a/hash.h b/hash.h
index 39a0164be32256fef2737c7f15a2b4c57f977569..cb85d26a2f0d3638997cc2911b63a55dbba75124 100644 (file)
--- a/hash.h
+++ b/hash.h
@@ -4,6 +4,8 @@
 #include "hash-ll.h"
 #include "repository.h"
 
-#define the_hash_algo the_repository->hash_algo
+#ifdef USE_THE_REPOSITORY_VARIABLE
+# define the_hash_algo the_repository->hash_algo
+#endif
 
 #endif
diff --git a/help.c b/help.c
index 1d057aa6073eef2d5b83640986b6eab564130a2f..10fdb1a03dd944bb7d40c90a9f49cb9627148cc5 100644 (file)
--- a/help.c
+++ b/help.c
@@ -1,3 +1,5 @@
+#define USE_THE_REPOSITORY_VARIABLE
+
 #include "git-compat-util.h"
 #include "config.h"
 #include "builtin.h"
diff --git a/hex.c b/hex.c
index bc9e86a978e50482af62b10b15e73c3b88def1df..5ca78a7744113b15ecb154f08ac0ecb524c86d66 100644 (file)
--- a/hex.c
+++ b/hex.c
@@ -1,3 +1,5 @@
+#define USE_THE_REPOSITORY_VARIABLE
+
 #include "git-compat-util.h"
 #include "hash.h"
 #include "hex.h"
index 5b65287ac90f24e70af6b1cfed08843aa6bbe774..7c0b3be968ab1be0ad5e3501ca05c432d53e8714 100644 (file)
@@ -1,3 +1,5 @@
+#define USE_THE_REPOSITORY_VARIABLE
+
 #include "git-compat-util.h"
 #include "config.h"
 #include "environment.h"
index a97df4a1fb1838d68f7eec278379054ff440eeaa..7315a694aa4b8aed50ad5cf4a14334fcdab41e75 100644 (file)
@@ -1,3 +1,5 @@
+#define USE_THE_REPOSITORY_VARIABLE
+
 #include "git-compat-util.h"
 #include "environment.h"
 #include "hex.h"
index b7110b6f82803b0bbce9b279d4f0d9b2a3e84131..e417a7f51ce3c36cfe11e398c9308af5ebc69aa4 100644 (file)
@@ -1,3 +1,5 @@
+#define USE_THE_REPOSITORY_VARIABLE
+
 #include "git-compat-util.h"
 #include "repository.h"
 #include "hex.h"
diff --git a/http.c b/http.c
index 67cc47d28faa47ea024a205d65405400ca94703a..6536816e8128bf94cffc8f0936d4de10dc674fbf 100644 (file)
--- a/http.c
+++ b/http.c
@@ -1,3 +1,5 @@
+#define USE_THE_REPOSITORY_VARIABLE
+
 #include "git-compat-util.h"
 #include "git-curl-compat.h"
 #include "hex.h"
index c5f363ca6f729ace28756467470e56363fad7a1e..00611107d20293b06157019dd6ff214a6dd0f286 100644 (file)
@@ -1,3 +1,5 @@
+#define USE_THE_REPOSITORY_VARIABLE
+
 #include "git-compat-util.h"
 #include "config.h"
 #include "gettext.h"
index 4346f8da4560fd518d73db7969faa9127e302090..49e2fa6f9758b9eebf268bc0a10e35297aaacf72 100644 (file)
@@ -1,3 +1,5 @@
+#define USE_THE_REPOSITORY_VARIABLE
+
 #include "git-compat-util.h"
 #include "dir.h"
 #include "gettext.h"
index 11ad8be411eeb29b3f1bb0fd798ab71e71791014..985d008799d0bb20a56ccaf6f821c699125373f6 100644 (file)
@@ -1,3 +1,5 @@
+#define USE_THE_REPOSITORY_VARIABLE
+
 #include "git-compat-util.h"
 #include "tag.h"
 #include "commit.h"
index 41416de4e3fbf130982455070f9118c0bcd1e469..223a4d94630eb6ebdd3e286ea22089e0a080c7e7 100644 (file)
@@ -1,3 +1,5 @@
+#define USE_THE_REPOSITORY_VARIABLE
+
 #include "git-compat-util.h"
 #include "commit-reach.h"
 #include "config.h"
diff --git a/loose.c b/loose.c
index f6faa6216a0812b7909a034e8abac5ee00e355c2..a8bf772172da01d3cc31f76f4aec859d8295c730 100644 (file)
--- a/loose.c
+++ b/loose.c
@@ -1,3 +1,5 @@
+#define USE_THE_REPOSITORY_VARIABLE
+
 #include "git-compat-util.h"
 #include "hash.h"
 #include "path.h"
index 398afe4ce3974a842e1e1fec3c4e4880c98f34c5..2dd925b43d067aa95b51ccf9d38d54174fea63c6 100644 (file)
--- a/ls-refs.c
+++ b/ls-refs.c
@@ -1,3 +1,5 @@
+#define USE_THE_REPOSITORY_VARIABLE
+
 #include "git-compat-util.h"
 #include "environment.h"
 #include "gettext.h"
index b2efe29b3d6bd89543e2591e06fd59434aef2c10..534a3eb4f08537026dbafec7e1bbacd738e2b327 100644 (file)
--- a/mailmap.c
+++ b/mailmap.c
@@ -1,3 +1,5 @@
+#define USE_THE_REPOSITORY_VARIABLE
+
 #include "git-compat-util.h"
 #include "environment.h"
 #include "string-list.h"
index 50c42e206164b407c14fffa36bc629f81df7eb1c..f17c74d483f849f9773d4c9c7a7645d05a5e7680 100644 (file)
@@ -1,3 +1,5 @@
+#define USE_THE_REPOSITORY_VARIABLE
+
 #include "git-compat-util.h"
 #include "hex.h"
 #include "match-trees.h"
index 2f659fd01432d4249d1d2be1876f0edfd8c9cd09..0ad0390fea568f019b04b6ca4e70aac3eafd5eb1 100644 (file)
@@ -1,3 +1,5 @@
+#define USE_THE_REPOSITORY_VARIABLE
+
 #include "git-compat-util.h"
 #include "merge-ll.h"
 #include "blob.h"
index eaede6cead9442995ef2f0ea2b449bceeaf0bcb7..691db9050ed6bf570b623a2523f75f62c8ca0d86 100644 (file)
@@ -14,6 +14,8 @@
  * "cale", "peedy", or "ins" instead of "ort"?)
  */
 
+#define USE_THE_REPOSITORY_VARIABLE
+
 #include "git-compat-util.h"
 #include "merge-ort.h"
 
index 8ff29ed09efb3303adf82d39c5fb54a0d11fc897..46ee364af736ac310c215771d315ac10c0c02d5e 100644 (file)
@@ -3,6 +3,9 @@
  * Fredrik Kuivinen.
  * The thieves were Alex Riesen and Johannes Schindelin, in June/July 2006
  */
+
+#define USE_THE_REPOSITORY_VARIABLE
+
 #include "git-compat-util.h"
 #include "merge-recursive.h"
 
diff --git a/merge.c b/merge.c
index 752a937fa93dd3bf8703400c6311afe7a5265e02..fe3efa4b24b7d10514cda3c3dfa6a06093dfc1f4 100644 (file)
--- a/merge.c
+++ b/merge.c
@@ -1,3 +1,5 @@
+#define USE_THE_REPOSITORY_VARIABLE
+
 #include "git-compat-util.h"
 #include "gettext.h"
 #include "hash.h"
index 55a6b63bac906f59443de91b0b117ccb061211fd..9a194e8aac64490dbc73d47fc5951a86081e81df 100644 (file)
@@ -1,3 +1,5 @@
+#define USE_THE_REPOSITORY_VARIABLE
+
 #include "git-compat-util.h"
 #include "abspath.h"
 #include "config.h"
diff --git a/midx.c b/midx.c
index 1e75f1a7eb11fd1a2416f7cee277aa896bd399ec..3992b054658366148eb51e1cb6ac753d60988694 100644 (file)
--- a/midx.c
+++ b/midx.c
@@ -1,3 +1,5 @@
+#define USE_THE_REPOSITORY_VARIABLE
+
 #include "git-compat-util.h"
 #include "config.h"
 #include "dir.h"
index 518b3c43b281bb35493878333aa9d58ce7393c51..e3fa5c3324933dd90b4622f32408b6469d9bf458 100644 (file)
@@ -1,3 +1,5 @@
+#define USE_THE_REPOSITORY_VARIABLE
+
 #include "git-compat-util.h"
 #include "default.h"
 #include "../commit.h"
index b7e008c2fdaf71b8105010a624a8c42263a1cdf5..f109928ad0b316c4a00f2004c61468442d246a5e 100644 (file)
@@ -1,3 +1,5 @@
+#define USE_THE_REPOSITORY_VARIABLE
+
 #include "git-compat-util.h"
 #include "skipping.h"
 #include "../commit.h"
index 038db01ca049e993bfb5b6f90eb9dd740e87f8cb..ecfdf6e43b575cda9cc808b05c8792291f61d3df 100644 (file)
@@ -1,3 +1,5 @@
+#define USE_THE_REPOSITORY_VARIABLE
+
 #include "git-compat-util.h"
 #include "notes-cache.h"
 #include "object-store-ll.h"
index 801941c2d1c365801b94a6d35a77da44d20664d7..d95e683414b0b6a0e576781ef861fff3bcfc1a7f 100644 (file)
@@ -1,3 +1,5 @@
+#define USE_THE_REPOSITORY_VARIABLE
+
 #include "git-compat-util.h"
 #include "advice.h"
 #include "commit.h"
index e33aa86c4b9f736da765f79072a48a28c841d70b..bca71274beea4d03f1b0af9b0a509f4fa991b669 100644 (file)
@@ -1,3 +1,5 @@
+#define USE_THE_REPOSITORY_VARIABLE
+
 #include "git-compat-util.h"
 #include "config.h"
 #include "commit.h"
diff --git a/notes.c b/notes.c
index afe2e2882e8df1e36bdd46be0f2d3bd69030d2f7..b6a13d0980bcc159a18ec1650130b69e9747415e 100644 (file)
--- a/notes.c
+++ b/notes.c
@@ -1,3 +1,5 @@
+#define USE_THE_REPOSITORY_VARIABLE
+
 #include "git-compat-util.h"
 #include "config.h"
 #include "environment.h"
index f684038f7f328ac5bb4df7c4b80f15808b0b4e73..958f61f094ac23d0f57de3cfe6b5dd6af9475ac0 100644 (file)
@@ -1,3 +1,5 @@
+#define USE_THE_REPOSITORY_VARIABLE
+
 #include "git-compat-util.h"
 #include "gettext.h"
 #include "strbuf.h"
index 72318c8dd479012ea7ab659ddb693ed475afd1d0..a6555ed68c500871f45b18622d0208993e2bf4bd 100644 (file)
@@ -6,6 +6,9 @@
  * This handles basic git object files - packing, unpacking,
  * creation etc.
  */
+
+#define USE_THE_REPOSITORY_VARIABLE
+
 #include "git-compat-util.h"
 #include "abspath.h"
 #include "config.h"
index 523af6f64f33512d1d7587bf0ce96cbe23b63b94..d7509514bcc2fb7b92fdc203875c9d72f164c217 100644 (file)
@@ -1,3 +1,5 @@
+#define USE_THE_REPOSITORY_VARIABLE
+
 #include "git-compat-util.h"
 #include "object-name.h"
 #include "advice.h"
index 93b5d97fdb2c3b1060df20bbbb854142790f69c5..0c0fcb76c0c80a874d70f66bbfdbddbf6ce19d19 100644 (file)
--- a/object.c
+++ b/object.c
@@ -1,3 +1,5 @@
+#define USE_THE_REPOSITORY_VARIABLE
+
 #include "git-compat-util.h"
 #include "gettext.h"
 #include "hex.h"
index 1f36651754edc47f733bc51bbecd716deee31ed4..9cac9743955d8ff1353a1523de86df20ce09a5b9 100644 (file)
@@ -1,3 +1,5 @@
+#define USE_THE_REPOSITORY_VARIABLE
+
 #include "git-compat-util.h"
 #include "oid-array.h"
 #include "hash-lookup.h"
index 75e668a057ca40a2d4daa36db0a5a9e04ca42b85..951c9c082f9f65e4f4c0fbd049364829f47fea3b 100644 (file)
@@ -1,3 +1,5 @@
+#define USE_THE_REPOSITORY_VARIABLE
+
 #include "git-compat-util.h"
 #include "commit-graph.h"
 #include "repository.h"
index 59d2e3a3877b296b803812b0facb5dbfc348c7ef..37a8ad0fb35277d5a8595b4de755615f48a5f137 100644 (file)
@@ -1,3 +1,5 @@
+#define USE_THE_REPOSITORY_VARIABLE
+
 #include "git-compat-util.h"
 #include "environment.h"
 #include "gettext.h"
index 184d28f05ceb591fa109d31568dccb17899e8ad5..7eafdce4eefbc165914a81910007ec01fc0653f5 100644 (file)
@@ -1,3 +1,5 @@
+#define USE_THE_REPOSITORY_VARIABLE
+
 #include "git-compat-util.h"
 #include "commit.h"
 #include "gettext.h"
index e7b214fcbde41fdb9e5012c135abd8209da942a9..e883dae3f24bb4c04c2f0ddf520e0e91bd209f07 100644 (file)
@@ -1,3 +1,5 @@
+#define USE_THE_REPOSITORY_VARIABLE
+
 #include "git-compat-util.h"
 #include "environment.h"
 #include "hex.h"
index fc63aa76a2611fc639475761d9ae4eeba9643cde..de922b47d23ee33ea434ee7f0834c8470a283d21 100644 (file)
@@ -1,3 +1,5 @@
+#define USE_THE_REPOSITORY_VARIABLE
+
 #include "git-compat-util.h"
 #include "gettext.h"
 #include "pack-revindex.h"
index eef625fa5b8f233608facabafbd27bf5a59a97d7..d07f03d0ab060ac3c698adf265c100864849bd76 100644 (file)
@@ -1,3 +1,5 @@
+#define USE_THE_REPOSITORY_VARIABLE
+
 #include "git-compat-util.h"
 #include "environment.h"
 #include "gettext.h"
index ec7312cd20aeb6bc3d4da25cd4ba085362b0347d..813584646f762ac096e971b9074c1a7bd0ca74c9 100644 (file)
@@ -1,3 +1,5 @@
+#define USE_THE_REPOSITORY_VARIABLE
+
 #include "git-compat-util.h"
 #include "environment.h"
 #include "gettext.h"
index d99d688d3ce25b2f1fd2837ad0f3d337aec15313..3fb7ce68cac11452b9d60c1455b5813326551a72 100644 (file)
@@ -1,3 +1,5 @@
+#define USE_THE_REPOSITORY_VARIABLE
+
 #include "git-compat-util.h"
 #include "parse-options.h"
 #include "branch.h"
diff --git a/path.c b/path.c
index adfb3d3eb709b3028eb4a41ef3306d34279cc01c..19f7684f3876bd1d88dcd04165abbee37b0f9769 100644 (file)
--- a/path.c
+++ b/path.c
@@ -1,6 +1,9 @@
 /*
  * Utilities for paths and pathnames
  */
+
+#define USE_THE_REPOSITORY_VARIABLE
+
 #include "git-compat-util.h"
 #include "abspath.h"
 #include "environment.h"
index 2133b9fe60a87c201186dc3f1840276104903f7f..fe1f0f41af081f5e171cff399a561a5bf798168e 100644 (file)
@@ -1,3 +1,5 @@
+#define USE_THE_REPOSITORY_VARIABLE
+
 #include "git-compat-util.h"
 #include "abspath.h"
 #include "parse.h"
index 22a81506b7a42c8dbb98f5c4b46d75a5366073f8..2c14a88abcdb30f4659bb360a0601e00294377db 100644 (file)
--- a/pretty.c
+++ b/pretty.c
@@ -1,3 +1,5 @@
+#define USE_THE_REPOSITORY_VARIABLE
+
 #include "git-compat-util.h"
 #include "config.h"
 #include "commit.h"
index c83cb60bf17eb490ccc3abc97a1b6f6679196e07..0d44c18edc0c522c3d8fb4769c26009439cc61ce 100644 (file)
@@ -9,6 +9,8 @@
  */
 
 #define GIT_TEST_PROGRESS_ONLY
+#define USE_THE_REPOSITORY_VARIABLE
+
 #include "git-compat-util.h"
 #include "pager.h"
 #include "progress.h"
index 2ca7c2ae48637b0f0ff8565625824aea89b80132..317e1b127fede4c8855559afd8547cbf558936fd 100644 (file)
@@ -1,3 +1,5 @@
+#define USE_THE_REPOSITORY_VARIABLE
+
 #include "git-compat-util.h"
 #include "gettext.h"
 #include "hex.h"
index c45b6d849cbf4f97ec3d6eb893259837d25d9052..5f01605550e57206accbf166a782681db4087eef 100644 (file)
@@ -1,3 +1,5 @@
+#define USE_THE_REPOSITORY_VARIABLE
+
 #include "git-compat-util.h"
 #include "environment.h"
 #include "gettext.h"
index 1224b300086fc99df57290494a75a168d2bb199f..46613a6bb6f536d0ac999ed0120011961f88dd7e 100644 (file)
@@ -1,3 +1,5 @@
+#define USE_THE_REPOSITORY_VARIABLE
+
 #include "git-compat-util.h"
 #include "gettext.h"
 #include "hex.h"
index 085b22faf3a01b86c849b67072625b5a11568cfc..48bf24f87c00c15e5a4b249b26eabc624546f901 100644 (file)
@@ -3,6 +3,9 @@
  *
  * Copyright (C) Linus Torvalds, 2005
  */
+
+#define USE_THE_REPOSITORY_VARIABLE
+
 #include "git-compat-util.h"
 #include "bulk-checkin.h"
 #include "config.h"
index c343e16fcddddec8601a2278ae3b5e39dbab770c..e93b38552352504c1951c84621e47c8260d92d3d 100644 (file)
@@ -1,3 +1,5 @@
+#define USE_THE_REPOSITORY_VARIABLE
+
 #include "git-compat-util.h"
 #include "commit.h"
 #include "editor.h"
index f7fb0c7e0ec1b8ab3af987245dcb048a87ca1f3a..8c5e673fc0a521425c1035ce3f31575c185c34ef 100644 (file)
@@ -1,3 +1,5 @@
+#define USE_THE_REPOSITORY_VARIABLE
+
 #include "git-compat-util.h"
 #include "environment.h"
 #include "gettext.h"
index 5f09552c5ca5e75fdeb2746b2b3d0c1dd57ac9d3..c7070b13b004b7c207a3f99740999f582c15c1b0 100644 (file)
@@ -1,3 +1,5 @@
+#define USE_THE_REPOSITORY_VARIABLE
+
 #include "git-compat-util.h"
 #include "commit.h"
 #include "refs.h"
index 3c80950186b6c30cd0fca7e6e2fc21fa7939d71f..5ca944529b30ccaf30d527789478349d915f10c1 100644 (file)
--- a/reflog.c
+++ b/reflog.c
@@ -1,3 +1,5 @@
+#define USE_THE_REPOSITORY_VARIABLE
+
 #include "git-compat-util.h"
 #include "gettext.h"
 #include "object-store-ll.h"
diff --git a/refs.c b/refs.c
index 6e7caefdcfd8eded5dabccaa511f8baf463ba3cb..727ed6c1d62d0bfae772ca976239207b1f8608aa 100644 (file)
--- a/refs.c
+++ b/refs.c
@@ -2,6 +2,8 @@
  * The backend-independent part of the reference module.
  */
 
+#define USE_THE_REPOSITORY_VARIABLE
+
 #include "git-compat-util.h"
 #include "advice.h"
 #include "config.h"
index b484b5880d61c6db25d18385935bf875d3108803..35931bc71e500bddeba2d9693659cda58a54c344 100644 (file)
@@ -1,3 +1,5 @@
+#define USE_THE_REPOSITORY_VARIABLE
+
 #include "../git-compat-util.h"
 #include "../copy.h"
 #include "../environment.h"
index 5ab1b21d10f826402d9b1ecf895df540e881bffb..a0666407cdff3ce8cd46f63c875f40d22d05e9e6 100644 (file)
@@ -1,3 +1,5 @@
+#define USE_THE_REPOSITORY_VARIABLE
+
 #include "../git-compat-util.h"
 #include "../config.h"
 #include "../dir.h"
index 57df2aba6613ccd380e3818f085ffc54a64ca920..6e34eb218885402f129e76d0513525edfea1417d 100644 (file)
@@ -1,3 +1,5 @@
+#define USE_THE_REPOSITORY_VARIABLE
+
 #include "../git-compat-util.h"
 #include "../abspath.h"
 #include "../chdir-notify.h"
index d60932f4ded876476b7dec21456b9088260d0d1f..c2e3e24351d134e84f46742d4d46a883ea69b7ab 100644 (file)
--- a/refspec.c
+++ b/refspec.c
@@ -1,3 +1,5 @@
+#define USE_THE_REPOSITORY_VARIABLE
+
 #include "git-compat-util.h"
 #include "gettext.h"
 #include "hash.h"
index 6008d7e87c4b72213c2d7c16f67f61366770f94c..1930f83cc713e7265a56ef79be2824998ae31c53 100644 (file)
@@ -1,3 +1,5 @@
+#define USE_THE_REPOSITORY_VARIABLE
+
 #include "git-compat-util.h"
 #include "git-curl-compat.h"
 #include "config.h"
index 10641710851a9739cb9d108a496ab2d7aba50f04..5fab7f0970580a6abef895a5e081bdb1e17a3d07 100644 (file)
--- a/remote.c
+++ b/remote.c
@@ -1,3 +1,5 @@
+#define USE_THE_REPOSITORY_VARIABLE
+
 #include "git-compat-util.h"
 #include "abspath.h"
 #include "config.h"
index 95d10cc4a0a75ab45373b12f8998c52d060cba40..9825a3089932ede3f5dc588874d618768988c283 100644 (file)
 #include "promisor-remote.h"
 #include "refs.h"
 
+/*
+ * We do not define `USE_THE_REPOSITORY_VARIABLE` in this file because we do
+ * not want to rely on functions that implicitly use `the_repository`. This
+ * means that the `extern` declaration of `the_repository` isn't visible here,
+ * which makes sparse unhappy. We thus declare it here.
+ */
+extern struct repository *the_repository;
+
 /* The main repository */
 static struct repository the_repo;
 struct repository *the_repository = &the_repo;
index a35cd77c356f0106a4ff0bc1b5c3329d393b2b00..29727edec6dbee864b904d318a132e53d5ef54a2 100644 (file)
@@ -197,7 +197,9 @@ struct repository {
        unsigned different_commondir:1;
 };
 
+#ifdef USE_THE_REPOSITORY_VARIABLE
 extern struct repository *the_repository;
+#endif
 
 /*
  * Define a custom repository layout. Any field can be NULL, which
index c7e1f8fd25c73ca4630f3682af5ed333858324b0..597256fa5b1659abcff258ca506586e7ad28bceb 100644 (file)
--- a/rerere.c
+++ b/rerere.c
@@ -1,3 +1,5 @@
+#define USE_THE_REPOSITORY_VARIABLE
+
 #include "git-compat-util.h"
 #include "abspath.h"
 #include "config.h"
diff --git a/reset.c b/reset.c
index 937f11c0f490986e172a9126ded0744c877d2666..9550dea03d9d80f8832f05be7a517babbba5d795 100644 (file)
--- a/reset.c
+++ b/reset.c
@@ -1,3 +1,5 @@
+#define USE_THE_REPOSITORY_VARIABLE
+
 #include "git-compat-util.h"
 #include "cache-tree.h"
 #include "gettext.h"
index 4e6f0e46769a9b4610663a295123d0308a73b478..8c9911affbe409cdc635f7fd1270225c30a51236 100644 (file)
@@ -1,3 +1,5 @@
+#define USE_THE_REPOSITORY_VARIABLE
+
 #include "git-compat-util.h"
 #include "dir.h"
 #include "hash.h"
index 7ddf0f151a381077c7e30d2a9835c4ec64947006..40da255953dae4268d4f726db9f8e737bcc3e2c4 100644 (file)
@@ -1,3 +1,5 @@
+#define USE_THE_REPOSITORY_VARIABLE
+
 #include "git-compat-util.h"
 #include "config.h"
 #include "environment.h"
index 31b20123d8f049a37ab408a9e7f9a66ea0f4c3f0..f5fde92b7c6c0541735473e0f6414dd21821fca6 100644 (file)
@@ -1,3 +1,5 @@
+#define USE_THE_REPOSITORY_VARIABLE
+
 #include "git-compat-util.h"
 #include "run-command.h"
 #include "environment.h"
index 331b91dbdb37aed7acbf45c631fb9fdb5df1b3a5..a1cb4b45b5c44b1c3036f805489d3e1fe61f078e 100644 (file)
--- a/scalar.c
+++ b/scalar.c
@@ -2,6 +2,8 @@
  * The Scalar command-line interface.
  */
 
+#define USE_THE_REPOSITORY_VARIABLE
+
 #include "git-compat-util.h"
 #include "abspath.h"
 #include "gettext.h"
index 37f59d4f66bbc2b21bf08288a75de4a159b24625..b42e6986df6e365cf7a68f1cd9c14d6cd32f9428 100644 (file)
@@ -1,3 +1,5 @@
+#define USE_THE_REPOSITORY_VARIABLE
+
 #include "git-compat-util.h"
 #include "config.h"
 #include "commit.h"
index 823691e379baaee999ec8242ad5d6f434c28b481..8083fe20bfb22e01234a9ab3d3f87548aca208c4 100644 (file)
@@ -1,3 +1,5 @@
+#define USE_THE_REPOSITORY_VARIABLE
+
 #include "git-compat-util.h"
 #include "abspath.h"
 #include "advice.h"
diff --git a/serve.c b/serve.c
index aa651b73e9b7a3378c51f7c92533a6dd0f82ce73..33608ea4d5b8c8be76c38a326847c36791c29d33 100644 (file)
--- a/serve.c
+++ b/serve.c
@@ -1,3 +1,5 @@
+#define USE_THE_REPOSITORY_VARIABLE
+
 #include "git-compat-util.h"
 #include "repository.h"
 #include "config.h"
index 6feaa457c5c2fccac9c4556db2a4acb1490c5a0d..97e839c33da98344221a4b2e0214cc2e6b5bad98 100644 (file)
@@ -1,3 +1,5 @@
+#define USE_THE_REPOSITORY_VARIABLE
+
 #include "git-compat-util.h"
 #include "dir.h"
 #include "environment.h"
diff --git a/setup.c b/setup.c
index 20f380825b5a365266f194297b6225724e186ed5..7e1169eb86b966dd86e8e59b8778cfe663e4c254 100644 (file)
--- a/setup.c
+++ b/setup.c
@@ -1,3 +1,5 @@
+#define USE_THE_REPOSITORY_VARIABLE
+
 #include "git-compat-util.h"
 #include "abspath.h"
 #include "copy.h"
index a0b181ba8a1636019d481c0bee850104f2a45973..31a6ca40fe2287e37092dc2251d1f6b8515455e0 100644 (file)
--- a/shallow.c
+++ b/shallow.c
@@ -1,3 +1,5 @@
+#define USE_THE_REPOSITORY_VARIABLE
+
 #include "git-compat-util.h"
 #include "hex.h"
 #include "repository.h"
index 058a8f448efd6e73315b39da92796b0af0598cc4..120c8190b187bc8c6c73630f06f5dd4dc994df30 100644 (file)
@@ -1,3 +1,5 @@
+#define USE_THE_REPOSITORY_VARIABLE
+
 #include "git-compat-util.h"
 #include "gettext.h"
 #include "hash.h"
index 10adf625b2e7ab23ffde1c8c826f6c10691792d8..38839511afc1924c8f85b017130e321b2f2f3ecd 100644 (file)
@@ -1,6 +1,9 @@
 /*
  * Copyright (c) 2011, Google Inc.
  */
+
+#define USE_THE_REPOSITORY_VARIABLE
+
 #include "git-compat-util.h"
 #include "convert.h"
 #include "environment.h"
index ad43a282da65c8422650257e88832edb4bc74a29..9b0bb0b9f441a0413c0c8ea316a4b03de678c912 100644 (file)
@@ -1,3 +1,5 @@
+#define USE_THE_REPOSITORY_VARIABLE
+
 #include "git-compat-util.h"
 #include "dir.h"
 #include "environment.h"
index caf3aa5600f77c595753647e602bd76fa6f885ec..ab99a30253083bc9f4d53120ed27b53d1caca2a1 100644 (file)
@@ -1,3 +1,5 @@
+#define USE_THE_REPOSITORY_VARIABLE
+
 #include "git-compat-util.h"
 #include "abspath.h"
 #include "repository.h"
index af43ee1cb5ee27c6aad608c7a233e234a7146f89..1f18d5700739fe4a754736e490c43d8d0a1ad521 100644 (file)
@@ -1,3 +1,5 @@
+#define USE_THE_REPOSITORY_VARIABLE
+
 #include "test-tool.h"
 #include "git-compat-util.h"
 #include "pack-bitmap.h"
index 1281e66876f35d380d5360be23883c5ed27aafcf..f7f9b620026bc18cb2915b27bfea9e80641e1259 100644 (file)
@@ -1,3 +1,5 @@
+#define USE_THE_REPOSITORY_VARIABLE
+
 #include "test-tool.h"
 #include "bloom.h"
 #include "hex.h"
index dc89ecfd71ee07289ca95001dfb833deb09bf4ff..5cdef3ebefc6281499f80a01456b8cf6c6944d5c 100644 (file)
@@ -1,3 +1,5 @@
+#define USE_THE_REPOSITORY_VARIABLE
+
 #include "test-tool.h"
 #include "gettext.h"
 #include "hex.h"
index 02b0b46c3f93fae47949ac299bfaa9c1423eff2c..3f0c7d0ed07ec99a4e19573d9871e3acdd3da463 100644 (file)
@@ -1,3 +1,5 @@
+#define USE_THE_REPOSITORY_VARIABLE
+
 #include "test-tool.h"
 #include "hash.h"
 #include "hex.h"
index 4f215fea025290f868defcae8bdca5aeefc627ba..1b7f37a84fb2ac1bfc110376e18d4ed4e2fd3d3c 100644 (file)
@@ -1,3 +1,5 @@
+#define USE_THE_REPOSITORY_VARIABLE
+
 #include "test-tool.h"
 #include "read-cache-ll.h"
 #include "repository.h"
index f472691a3ca95b14266cdc0c0f64ce26d9daa323..a6720faf9ca99d4e523cb2ce056b74867bd4a024 100644 (file)
@@ -1,3 +1,5 @@
+#define USE_THE_REPOSITORY_VARIABLE
+
 #include "test-tool.h"
 #include "hex.h"
 #include "read-cache-ll.h"
index 9ff67c39676f9d2b0d66c9f23f433328a32f160c..4f010d53249520fb357d630b040cdfca21af6572 100644 (file)
@@ -1,3 +1,5 @@
+#define USE_THE_REPOSITORY_VARIABLE
+
 #include "test-tool.h"
 #include "dir.h"
 #include "hex.h"
index e8bd793e58c7d21b87a99adff67722661c303090..14b2b0c12c0da366e78fe91acd9b0ef0045673b8 100644 (file)
@@ -1,3 +1,5 @@
+#define USE_THE_REPOSITORY_VARIABLE
+
 #include "test-tool.h"
 #include "object-name.h"
 #include "object-store.h"
index 8280984d08fe84b23722948709e83252e5d40895..02bfe92e8d55b76b83337474bb0b8d4d82b1fa2e 100644 (file)
@@ -3,6 +3,8 @@
  * a `git fsmonitor--daemon` daemon.
  */
 
+#define USE_THE_REPOSITORY_VARIABLE
+
 #include "test-tool.h"
 #include "parse-options.h"
 #include "fsmonitor-ipc.h"
index 5f33bb7b8f9d0527aca4257691ef6499068e55ae..40f5df4412adf1a3c35372de7f7cc64006a58037 100644 (file)
@@ -1,3 +1,5 @@
+#define USE_THE_REPOSITORY_VARIABLE
+
 #include "test-tool.h"
 #include "environment.h"
 #include "name-hash.h"
index d0db5ff26f0772373b5ccba7ad0aa89df01548ff..e0e2048320d58363e6ca582801f9ecfdf9f4fcc9 100644 (file)
@@ -1,3 +1,5 @@
+#define USE_THE_REPOSITORY_VARIABLE
+
 #include "test-tool.h"
 #include "hex.h"
 #include "match-trees.h"
index bd30244a54cc88370ab27da5d25108b78c296f85..c03cfa5ecf99a86abf28132e3c3b2aa7f7037e04 100644 (file)
@@ -1,3 +1,5 @@
+#define USE_THE_REPOSITORY_VARIABLE
+
 #include "test-tool.h"
 #include "hex.h"
 #include "object-name.h"
index 67a964ef9041a061497c0b10698413d360f561e1..f8f9afbb5b1f57b09abf41359dbeb5e418343ab8 100644 (file)
@@ -1,3 +1,5 @@
+#define USE_THE_REPOSITORY_VARIABLE
+
 #include "test-tool.h"
 #include "hex.h"
 #include "strbuf.h"
index 1ba226f1f9ca8ae05f0310891428e82d740cb47b..5dd374379c78c9b19f7ff7bdc93bb9c2e3b91a59 100644 (file)
@@ -1,3 +1,5 @@
+#define USE_THE_REPOSITORY_VARIABLE
+
 #include "test-tool.h"
 #include "commit.h"
 #include "commit-reach.h"
index e803c43ece92def7bc69c253a49bc5602129d22c..d285c656bd3a3276c7c3e1b7e5a88f2d276223ab 100644 (file)
@@ -1,3 +1,5 @@
+#define USE_THE_REPOSITORY_VARIABLE
+
 #include "test-tool.h"
 #include "config.h"
 #include "read-cache-ll.h"
index 8c7a83f578f41c3d90bcb17628bd5307e5927636..d9e980d04c083637d6a179ab4b9486f0958f4ff5 100644 (file)
@@ -1,3 +1,5 @@
+#define USE_THE_REPOSITORY_VARIABLE
+
 #include "test-tool.h"
 #include "commit-graph.h"
 #include "repository.h"
index 4acae41bb993c883970227f394a61603a6e7152d..83effc2b5fea11bab3da3432c79422567309037c 100644 (file)
@@ -1,3 +1,5 @@
+#define USE_THE_REPOSITORY_VARIABLE
+
 #include "test-tool.h"
 #include "hex.h"
 #include "midx.h"
index ad24300170e71552f8f001f5e3a737562e606f6f..637b8b294e90df8ec3caf1639c73543d1f01074f 100644 (file)
@@ -1,3 +1,5 @@
+#define USE_THE_REPOSITORY_VARIABLE
+
 #include "test-tool.h"
 #include "hex.h"
 #include "refs.h"
index 0c7c5aa4dd7641a72b930b57eeff17dbf90c4c16..c6a074df3d2d94a2c039365fb897768df6e18696 100644 (file)
@@ -1,3 +1,5 @@
+#define USE_THE_REPOSITORY_VARIABLE
+
 #include "test-tool.h"
 #include "commit-graph.h"
 #include "commit.h"
index f346951bc28c99e4791d841fac0d873a128cc973..071f5bd1e21974ba2104a76305a5156ee2c2961f 100644 (file)
@@ -8,6 +8,8 @@
  * published by the Free Software Foundation.
  */
 
+#define USE_THE_REPOSITORY_VARIABLE
+
 #include "test-tool.h"
 #include "commit.h"
 #include "diff.h"
index 737cbe475bd6909bbec85df169ad0c4dd888b012..64fff6e9e3ce87454d39a139dd6b5b5e4c353e8f 100644 (file)
@@ -1,3 +1,5 @@
+#define USE_THE_REPOSITORY_VARIABLE
+
 #include "test-tool.h"
 #include "lockfile.h"
 #include "read-cache-ll.h"
index 4b809d9dcac3ec99d85c41c6b5efe4e574c7b255..cbe93f2f9e0178d6e1b84f201a51030e504fad2d 100644 (file)
@@ -1,3 +1,5 @@
+#define USE_THE_REPOSITORY_VARIABLE
+
 #include "test-tool.h"
 #include "config.h"
 #include "hash.h"
index ecd40ded995c0f88b2b58de0d08fd2a1831fca26..6ca069ce63370de9977c5b653d0e5b6abd26fba9 100644 (file)
@@ -1,3 +1,5 @@
+#define USE_THE_REPOSITORY_VARIABLE
+
 #include "test-tool.h"
 #include "repository.h"
 #include "setup.h"
index 7197969a08149699a14c758ceef1223e494b7c35..22e518d22905261fbc735383fd443e06ce7c203b 100644 (file)
@@ -1,3 +1,5 @@
+#define USE_THE_REPOSITORY_VARIABLE
+
 #include "test-tool.h"
 #include "test-tool-utils.h"
 #include "parse-options.h"
index 1adac29a575254492f206bf4c4e4b6cab08f999d..cd955ec63e90fd79b507af4e6de2150d3beef051 100644 (file)
@@ -1,3 +1,5 @@
+#define USE_THE_REPOSITORY_VARIABLE
+
 #include "test-tool.h"
 #include "strvec.h"
 #include "run-command.h"
index 7e3da380a955f55895ab886911aedf8f1f5ec719..b37dd2c5d6db64d5ff0b8e0f6689f14fe59700d9 100644 (file)
@@ -1,3 +1,5 @@
+#define USE_THE_REPOSITORY_VARIABLE
+
 #include "test-tool.h"
 #include "lockfile.h"
 #include "read-cache-ll.h"
index 3c856a8cf21e4fba7055cb33465b35be5860eb7e..a4a75db735afbef5754cd0f23df8ea953e8f3ee6 100644 (file)
@@ -1,3 +1,5 @@
+#define USE_THE_REPOSITORY_VARIABLE
+
 #include "test-lib.h"
 #include "object.h"
 #include "decorate.h"
diff --git a/tag.c b/tag.c
index 52bbe508191f36ba38b2d524fba09bb36f8e7248..d24170e34062f05f06f3f791f3e2a3a296dc5022 100644 (file)
--- a/tag.c
+++ b/tag.c
@@ -1,3 +1,5 @@
+#define USE_THE_REPOSITORY_VARIABLE
+
 #include "git-compat-util.h"
 #include "environment.h"
 #include "tag.h"
index 3509258be53644973ca2b2b04cc0ec5b27ea96c6..a8e4553f2749bad1df72269b625d22a7fbd5b2b2 100644 (file)
@@ -1,3 +1,5 @@
+#define USE_THE_REPOSITORY_VARIABLE
+
 #include "git-compat-util.h"
 #include "tmp-objdir.h"
 #include "abspath.h"
index 9820947ab2dee57bf4853d14a9fa3d970331aec9..09b3560ffdc41e52eff6fdc049222a802ef9ee46 100644 (file)
@@ -1,3 +1,5 @@
+#define USE_THE_REPOSITORY_VARIABLE
+
 #include "git-compat-util.h"
 #include "transport.h"
 #include "quote.h"
index 83ddea8fbc03875b6a9683b37f1fbc27d3d2984b..b9c8827ed941a5e00426d8c2c82d4bf4dfc41883 100644 (file)
@@ -1,3 +1,5 @@
+#define USE_THE_REPOSITORY_VARIABLE
+
 #include "git-compat-util.h"
 #include "advice.h"
 #include "config.h"
index 535a3a25399aebbac55c2a9097877e2b08601ec9..a03339796561b49cc62981d664895b42b32ece72 100644 (file)
@@ -1,3 +1,5 @@
+#define USE_THE_REPOSITORY_VARIABLE
+
 #include "git-compat-util.h"
 #include "tree-walk.h"
 #include "dir.h"
diff --git a/tree.c b/tree.c
index 7973d3f9a83228a70586cf211d8a8eec7b21f639..ad86ad1ba99b74ba6556c369005c0363324be952 100644 (file)
--- a/tree.c
+++ b/tree.c
@@ -1,3 +1,5 @@
+#define USE_THE_REPOSITORY_VARIABLE
+
 #include "git-compat-util.h"
 #include "hex.h"
 #include "tree.h"
index 304ea2ed86b1e4879580ebea1c3b78877ad8fe1c..7dc884fafd30a36451dee70f616da4c3fe936bbb 100644 (file)
@@ -1,3 +1,5 @@
+#define USE_THE_REPOSITORY_VARIABLE
+
 #include "git-compat-util.h"
 #include "advice.h"
 #include "strvec.h"
index b726f7a57d0af9611f5d903a65501dd5284c27c2..0052c6a4dce1fad808a5bdd2c92c0827c5453d18 100644 (file)
@@ -1,3 +1,5 @@
+#define USE_THE_REPOSITORY_VARIABLE
+
 #include "git-compat-util.h"
 #include "config.h"
 #include "environment.h"
index 946d86b04eeccec308bb800f0ab6d6cec073c833..0fafdc97cf17e8ffa9d90d82b6929641b56d66ae 100644 (file)
--- a/walker.c
+++ b/walker.c
@@ -1,3 +1,5 @@
+#define USE_THE_REPOSITORY_VARIABLE
+
 #include "git-compat-util.h"
 #include "gettext.h"
 #include "hex.h"
index 70844d023a2f796c452188a60e7404ee48298d64..f3c4c8ec54d6c41373e22d837e98864260cfa750 100644 (file)
@@ -1,3 +1,5 @@
+#define USE_THE_REPOSITORY_VARIABLE
+
 #include "git-compat-util.h"
 #include "abspath.h"
 #include "environment.h"
index 5051f5e599b03fb0800aff8bd031b16c7a47977a..8815df419e7adb1ece7c85574bff04945194ab89 100644 (file)
@@ -1,3 +1,5 @@
+#define USE_THE_REPOSITORY_VARIABLE
+
 #include "git-compat-util.h"
 #include "advice.h"
 #include "wt-status.h"
index 16ed8ac492856f141165296d523a319dfd1b4108..d5dc88661e72078df3ce9e39a3ea7e15fd46092e 100644 (file)
@@ -1,3 +1,5 @@
+#define USE_THE_REPOSITORY_VARIABLE
+
 #include "git-compat-util.h"
 #include "gettext.h"
 #include "config.h"