builtin: remove USE_THE_REPOSITORY_VARIABLE from builtin.h
Instead of including USE_THE_REPOSITORY_VARIABLE by default on every
builtin, remove it from builtin.h and add it to all the builtins that
include builtin.h (by definition, that means all builtins/*.c).
Also, remove the include statement for repository.h since it gets
brought in through builtin.h.
The next step will be to migrate each builtin
from having to use the_repository.
Signed-off-by: John Cai <johncai86@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
diff --git a/builtin.h b/builtin.h
index fc6fc8f..f7b166b 100644
--- a/builtin.h
+++ b/builtin.h
@@ -1,14 +1,6 @@
#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"
#include "repository.h"
diff --git a/builtin/add.c b/builtin/add.c
index ba33151..c893ff4 100644
--- a/builtin/add.c
+++ b/builtin/add.c
@@ -3,7 +3,7 @@
*
* Copyright (C) 2006 Linus Torvalds
*/
-
+#define USE_THE_REPOSITORY_VARIABLE
#include "builtin.h"
#include "advice.h"
#include "config.h"
@@ -18,7 +18,6 @@
#include "preload-index.h"
#include "diff.h"
#include "read-cache.h"
-#include "repository.h"
#include "revision.h"
#include "bulk-checkin.h"
#include "strvec.h"
diff --git a/builtin/am.c b/builtin/am.c
index 8c610ee..7693891 100644
--- a/builtin/am.c
+++ b/builtin/am.c
@@ -4,6 +4,7 @@
* Based on git-am.sh by Junio C Hamano.
*/
+#define USE_THE_REPOSITORY_VARIABLE
#include "builtin.h"
#include "abspath.h"
#include "advice.h"
@@ -38,7 +39,6 @@
#include "string-list.h"
#include "pager.h"
#include "path.h"
-#include "repository.h"
#include "pretty.h"
/**
diff --git a/builtin/annotate.c b/builtin/annotate.c
index 0abf89e..a99179f 100644
--- a/builtin/annotate.c
+++ b/builtin/annotate.c
@@ -3,6 +3,8 @@
*
* Copyright (C) 2006 Ryan Anderson
*/
+
+#define USE_THE_REPOSITORY_VARIABLE
#include "git-compat-util.h"
#include "builtin.h"
#include "strvec.h"
diff --git a/builtin/apply.c b/builtin/apply.c
index ca0bb97..84f1863 100644
--- a/builtin/apply.c
+++ b/builtin/apply.c
@@ -1,6 +1,6 @@
+#define USE_THE_REPOSITORY_VARIABLE
#include "builtin.h"
#include "gettext.h"
-#include "repository.h"
#include "hash.h"
#include "apply.h"
diff --git a/builtin/archive.c b/builtin/archive.c
index de59c3a..22f7c63 100644
--- a/builtin/archive.c
+++ b/builtin/archive.c
@@ -2,13 +2,13 @@
* Copyright (c) 2006 Franck Bui-Huu
* Copyright (c) 2006 Rene Scharfe
*/
+#define USE_THE_REPOSITORY_VARIABLE
#include "builtin.h"
#include "archive.h"
#include "gettext.h"
#include "transport.h"
#include "parse-options.h"
#include "pkt-line.h"
-#include "repository.h"
static void create_output_file(const char *output_file)
{
diff --git a/builtin/bisect.c b/builtin/bisect.c
index b83056d..5e91c59 100644
--- a/builtin/bisect.c
+++ b/builtin/bisect.c
@@ -1,3 +1,4 @@
+#define USE_THE_REPOSITORY_VARIABLE
#include "builtin.h"
#include "copy.h"
#include "environment.h"
diff --git a/builtin/blame.c b/builtin/blame.c
index 728a624..472dd76 100644
--- a/builtin/blame.c
+++ b/builtin/blame.c
@@ -4,7 +4,7 @@
* Copyright (c) 2006, 2014 by its authors
* See COPYING for licensing conditions
*/
-
+#define USE_THE_REPOSITORY_VARIABLE
#include "builtin.h"
#include "config.h"
#include "color.h"
@@ -12,7 +12,6 @@
#include "environment.h"
#include "gettext.h"
#include "hex.h"
-#include "repository.h"
#include "commit.h"
#include "diff.h"
#include "revision.h"
diff --git a/builtin/branch.c b/builtin/branch.c
index 7980d2e..7112459 100644
--- a/builtin/branch.c
+++ b/builtin/branch.c
@@ -4,7 +4,7 @@
* Copyright (c) 2006 Kristian Høgsberg <krh@redhat.com>
* Based on git-branch.sh by Junio C Hamano.
*/
-
+#define USE_THE_REPOSITORY_VARIABLE
#include "builtin.h"
#include "config.h"
#include "color.h"
diff --git a/builtin/bugreport.c b/builtin/bugreport.c
index aeab40c..7c2df03 100644
--- a/builtin/bugreport.c
+++ b/builtin/bugreport.c
@@ -1,3 +1,4 @@
+#define USE_THE_REPOSITORY_VARIABLE
#include "builtin.h"
#include "abspath.h"
#include "editor.h"
diff --git a/builtin/bundle.c b/builtin/bundle.c
index 97f7f53..cabb20b 100644
--- a/builtin/bundle.c
+++ b/builtin/bundle.c
@@ -1,3 +1,4 @@
+#define USE_THE_REPOSITORY_VARIABLE
#include "builtin.h"
#include "abspath.h"
#include "gettext.h"
@@ -5,7 +6,6 @@
#include "strvec.h"
#include "parse-options.h"
#include "pkt-line.h"
-#include "repository.h"
#include "bundle.h"
/*
diff --git a/builtin/cat-file.c b/builtin/cat-file.c
index b244b5a..b9b754b 100644
--- a/builtin/cat-file.c
+++ b/builtin/cat-file.c
@@ -3,7 +3,7 @@
*
* Copyright (C) Linus Torvalds, 2005
*/
-
+#define USE_THE_REPOSITORY_VARIABLE
#include "builtin.h"
#include "config.h"
#include "convert.h"
diff --git a/builtin/check-attr.c b/builtin/check-attr.c
index ffd1067..7cf275b 100644
--- a/builtin/check-attr.c
+++ b/builtin/check-attr.c
@@ -1,3 +1,4 @@
+#define USE_THE_REPOSITORY_VARIABLE
#include "builtin.h"
#include "config.h"
#include "attr.h"
@@ -5,7 +6,6 @@
#include "gettext.h"
#include "object-name.h"
#include "quote.h"
-#include "repository.h"
#include "setup.h"
#include "parse-options.h"
#include "write-or-die.h"
diff --git a/builtin/check-ignore.c b/builtin/check-ignore.c
index 70565b9..7b7831d 100644
--- a/builtin/check-ignore.c
+++ b/builtin/check-ignore.c
@@ -1,3 +1,4 @@
+#define USE_THE_REPOSITORY_VARIABLE
#include "builtin.h"
#include "config.h"
#include "dir.h"
@@ -5,7 +6,6 @@
#include "quote.h"
#include "pathspec.h"
#include "parse-options.h"
-#include "repository.h"
#include "submodule.h"
#include "write-or-die.h"
diff --git a/builtin/check-mailmap.c b/builtin/check-mailmap.c
index 87cc036..c061046 100644
--- a/builtin/check-mailmap.c
+++ b/builtin/check-mailmap.c
@@ -1,3 +1,4 @@
+#define USE_THE_REPOSITORY_VARIABLE
#include "builtin.h"
#include "config.h"
#include "gettext.h"
diff --git a/builtin/check-ref-format.c b/builtin/check-ref-format.c
index 6874edb..6594517 100644
--- a/builtin/check-ref-format.c
+++ b/builtin/check-ref-format.c
@@ -1,7 +1,7 @@
/*
* GIT - The information manager from hell
*/
-
+#define USE_THE_REPOSITORY_VARIABLE
#include "builtin.h"
#include "refs.h"
#include "setup.h"
diff --git a/builtin/checkout--worker.c b/builtin/checkout--worker.c
index f53e108..ff6cdcc 100644
--- a/builtin/checkout--worker.c
+++ b/builtin/checkout--worker.c
@@ -1,3 +1,4 @@
+#define USE_THE_REPOSITORY_VARIABLE
#include "builtin.h"
#include "config.h"
#include "entry.h"
diff --git a/builtin/checkout-index.c b/builtin/checkout-index.c
index 98247ff..6dd38eb 100644
--- a/builtin/checkout-index.c
+++ b/builtin/checkout-index.c
@@ -4,13 +4,12 @@
* Copyright (C) 2005 Linus Torvalds
*
*/
-
+#define USE_THE_REPOSITORY_VARIABLE
#include "builtin.h"
#include "config.h"
#include "gettext.h"
#include "lockfile.h"
#include "quote.h"
-#include "repository.h"
#include "cache-tree.h"
#include "parse-options.h"
#include "entry.h"
diff --git a/builtin/checkout.c b/builtin/checkout.c
index d3bc486..d6defc3 100644
--- a/builtin/checkout.c
+++ b/builtin/checkout.c
@@ -1,3 +1,4 @@
+#define USE_THE_REPOSITORY_VARIABLE
#include "builtin.h"
#include "advice.h"
#include "branch.h"
diff --git a/builtin/clean.c b/builtin/clean.c
index b5887f8..9c48dd0 100644
--- a/builtin/clean.c
+++ b/builtin/clean.c
@@ -5,7 +5,7 @@
*
* Based on git-clean.sh by Pavel Roskin
*/
-
+#define USE_THE_REPOSITORY_VARIABLE
#include "builtin.h"
#include "abspath.h"
#include "config.h"
@@ -14,7 +14,6 @@
#include "parse-options.h"
#include "path.h"
#include "read-cache-ll.h"
-#include "repository.h"
#include "setup.h"
#include "string-list.h"
#include "quote.h"
diff --git a/builtin/clone.c b/builtin/clone.c
index 1b82310..e77339c 100644
--- a/builtin/clone.c
+++ b/builtin/clone.c
@@ -7,8 +7,9 @@
*
* Clone a repository into a different directory that does not yet exist.
*/
-
+#define USE_THE_REPOSITORY_VARIABLE
#include "builtin.h"
+
#include "abspath.h"
#include "advice.h"
#include "config.h"
diff --git a/builtin/column.c b/builtin/column.c
index 93f84be..50314cc 100644
--- a/builtin/column.c
+++ b/builtin/column.c
@@ -1,3 +1,4 @@
+#define USE_THE_REPOSITORY_VARIABLE
#include "builtin.h"
#include "config.h"
#include "gettext.h"
diff --git a/builtin/commit-graph.c b/builtin/commit-graph.c
index 65ce98d..81e577c 100644
--- a/builtin/commit-graph.c
+++ b/builtin/commit-graph.c
@@ -1,3 +1,4 @@
+#define USE_THE_REPOSITORY_VARIABLE
#include "builtin.h"
#include "commit.h"
#include "config.h"
@@ -5,7 +6,6 @@
#include "gettext.h"
#include "hex.h"
#include "parse-options.h"
-#include "repository.h"
#include "commit-graph.h"
#include "object-store-ll.h"
#include "progress.h"
diff --git a/builtin/commit-tree.c b/builtin/commit-tree.c
index bd8bf32..2ca1a57 100644
--- a/builtin/commit-tree.c
+++ b/builtin/commit-tree.c
@@ -3,13 +3,14 @@
*
* Copyright (C) Linus Torvalds, 2005
*/
+#define USE_THE_REPOSITORY_VARIABLE
#include "builtin.h"
#include "config.h"
#include "gettext.h"
#include "hex.h"
#include "object-name.h"
#include "object-store-ll.h"
-#include "repository.h"
+
#include "commit.h"
#include "parse-options.h"
diff --git a/builtin/commit.c b/builtin/commit.c
index 768d76a..fd1cc42 100644
--- a/builtin/commit.c
+++ b/builtin/commit.c
@@ -4,7 +4,7 @@
* Copyright (c) 2007 Kristian Høgsberg <krh@redhat.com>
* Based on git-commit.sh by Junio C Hamano and Linus Torvalds
*/
-
+#define USE_THE_REPOSITORY_VARIABLE
#include "builtin.h"
#include "advice.h"
#include "config.h"
diff --git a/builtin/config.c b/builtin/config.c
index 841a5d7..faa0ee7 100644
--- a/builtin/config.c
+++ b/builtin/config.c
@@ -1,10 +1,10 @@
+#define USE_THE_REPOSITORY_VARIABLE
#include "builtin.h"
#include "abspath.h"
#include "config.h"
#include "color.h"
#include "editor.h"
#include "environment.h"
-#include "repository.h"
#include "gettext.h"
#include "ident.h"
#include "parse-options.h"
diff --git a/builtin/count-objects.c b/builtin/count-objects.c
index 6b905da..3d7b289 100644
--- a/builtin/count-objects.c
+++ b/builtin/count-objects.c
@@ -3,14 +3,13 @@
*
* Copyright (c) 2006 Junio C Hamano
*/
-
+#define USE_THE_REPOSITORY_VARIABLE
#include "builtin.h"
#include "config.h"
#include "dir.h"
#include "environment.h"
#include "gettext.h"
#include "path.h"
-#include "repository.h"
#include "parse-options.h"
#include "quote.h"
#include "packfile.h"
diff --git a/builtin/credential-cache--daemon.c b/builtin/credential-cache--daemon.c
index 4caaf38..bc22f5c 100644
--- a/builtin/credential-cache--daemon.c
+++ b/builtin/credential-cache--daemon.c
@@ -1,3 +1,4 @@
+#define USE_THE_REPOSITORY_VARIABLE
#include "builtin.h"
#include "abspath.h"
#include "gettext.h"
diff --git a/builtin/credential-cache.c b/builtin/credential-cache.c
index 5de8b91..1918c47 100644
--- a/builtin/credential-cache.c
+++ b/builtin/credential-cache.c
@@ -1,3 +1,4 @@
+#define USE_THE_REPOSITORY_VARIABLE
#include "builtin.h"
#include "credential.h"
#include "gettext.h"
diff --git a/builtin/credential-store.c b/builtin/credential-store.c
index 1287040..e669e99 100644
--- a/builtin/credential-store.c
+++ b/builtin/credential-store.c
@@ -1,3 +1,4 @@
+#define USE_THE_REPOSITORY_VARIABLE
#include "builtin.h"
#include "config.h"
#include "gettext.h"
diff --git a/builtin/credential.c b/builtin/credential.c
index 796422c..14c8c66 100644
--- a/builtin/credential.c
+++ b/builtin/credential.c
@@ -1,3 +1,5 @@
+#define USE_THE_REPOSITORY_VARIABLE
+
#include "git-compat-util.h"
#include "credential.h"
#include "builtin.h"
diff --git a/builtin/describe.c b/builtin/describe.c
index 1c1c250..7929223 100644
--- a/builtin/describe.c
+++ b/builtin/describe.c
@@ -1,3 +1,4 @@
+#define USE_THE_REPOSITORY_VARIABLE
#include "builtin.h"
#include "config.h"
#include "environment.h"
diff --git a/builtin/diagnose.c b/builtin/diagnose.c
index 66a22d9..5ac7872 100644
--- a/builtin/diagnose.c
+++ b/builtin/diagnose.c
@@ -1,3 +1,4 @@
+#define USE_THE_REPOSITORY_VARIABLE
#include "builtin.h"
#include "abspath.h"
#include "gettext.h"
diff --git a/builtin/diff-files.c b/builtin/diff-files.c
index 7f4f9bc..b8ec420 100644
--- a/builtin/diff-files.c
+++ b/builtin/diff-files.c
@@ -3,13 +3,13 @@
*
* Copyright (C) Linus Torvalds, 2005
*/
+#define USE_THE_REPOSITORY_VARIABLE
#include "builtin.h"
#include "config.h"
#include "diff.h"
#include "diff-merges.h"
#include "commit.h"
#include "preload-index.h"
-#include "repository.h"
#include "revision.h"
static const char diff_files_usage[] =
diff --git a/builtin/diff-index.c b/builtin/diff-index.c
index 8abec38..e87f717 100644
--- a/builtin/diff-index.c
+++ b/builtin/diff-index.c
@@ -1,10 +1,10 @@
+#define USE_THE_REPOSITORY_VARIABLE
#include "builtin.h"
#include "config.h"
#include "diff.h"
#include "diff-merges.h"
#include "commit.h"
#include "preload-index.h"
-#include "repository.h"
#include "revision.h"
#include "setup.h"
diff --git a/builtin/diff-tree.c b/builtin/diff-tree.c
index 841448b..715995c 100644
--- a/builtin/diff-tree.c
+++ b/builtin/diff-tree.c
@@ -1,3 +1,4 @@
+#define USE_THE_REPOSITORY_VARIABLE
#include "builtin.h"
#include "config.h"
#include "diff.h"
@@ -6,7 +7,6 @@
#include "hex.h"
#include "log-tree.h"
#include "read-cache-ll.h"
-#include "repository.h"
#include "revision.h"
#include "tmp-objdir.h"
#include "tree.h"
diff --git a/builtin/diff.c b/builtin/diff.c
index 499b787..63e790b 100644
--- a/builtin/diff.c
+++ b/builtin/diff.c
@@ -3,7 +3,7 @@
*
* Copyright (c) 2006 Junio C Hamano
*/
-
+#define USE_THE_REPOSITORY_VARIABLE
#include "builtin.h"
#include "config.h"
#include "ewah/ewok.h"
diff --git a/builtin/difftool.c b/builtin/difftool.c
index c8700d6..f7dfa1f 100644
--- a/builtin/difftool.c
+++ b/builtin/difftool.c
@@ -11,8 +11,9 @@
*
* Copyright (C) 2016 Johannes Schindelin
*/
-
+#define USE_THE_REPOSITORY_VARIABLE
#include "builtin.h"
+
#include "abspath.h"
#include "config.h"
#include "copy.h"
diff --git a/builtin/fast-export.c b/builtin/fast-export.c
index 1bd5949..e17f262 100644
--- a/builtin/fast-export.c
+++ b/builtin/fast-export.c
@@ -3,6 +3,7 @@
*
* Copyright (C) 2007 Johannes E. Schindelin
*/
+#define USE_THE_REPOSITORY_VARIABLE
#include "builtin.h"
#include "config.h"
#include "gettext.h"
diff --git a/builtin/fast-import.c b/builtin/fast-import.c
index 4b9e341..1e7ab67 100644
--- a/builtin/fast-import.c
+++ b/builtin/fast-import.c
@@ -1,9 +1,9 @@
+#define USE_THE_REPOSITORY_VARIABLE
#include "builtin.h"
#include "abspath.h"
#include "environment.h"
#include "gettext.h"
#include "hex.h"
-#include "repository.h"
#include "config.h"
#include "lockfile.h"
#include "object.h"
diff --git a/builtin/fetch-pack.c b/builtin/fetch-pack.c
index fddd8a2..d2c4304 100644
--- a/builtin/fetch-pack.c
+++ b/builtin/fetch-pack.c
@@ -1,3 +1,4 @@
+#define USE_THE_REPOSITORY_VARIABLE
#include "builtin.h"
#include "gettext.h"
#include "hex.h"
diff --git a/builtin/fetch.c b/builtin/fetch.c
index 46ecfc5..9e68114 100644
--- a/builtin/fetch.c
+++ b/builtin/fetch.c
@@ -1,13 +1,13 @@
/*
* "git fetch"
*/
+#define USE_THE_REPOSITORY_VARIABLE
#include "builtin.h"
#include "advice.h"
#include "config.h"
#include "gettext.h"
#include "environment.h"
#include "hex.h"
-#include "repository.h"
#include "refs.h"
#include "refspec.h"
#include "object-name.h"
diff --git a/builtin/fmt-merge-msg.c b/builtin/fmt-merge-msg.c
index 1fba4cf..324e904 100644
--- a/builtin/fmt-merge-msg.c
+++ b/builtin/fmt-merge-msg.c
@@ -1,3 +1,4 @@
+#define USE_THE_REPOSITORY_VARIABLE
#include "builtin.h"
#include "config.h"
#include "fmt-merge-msg.h"
diff --git a/builtin/for-each-ref.c b/builtin/for-each-ref.c
index b118758..8085ebd 100644
--- a/builtin/for-each-ref.c
+++ b/builtin/for-each-ref.c
@@ -1,3 +1,4 @@
+#define USE_THE_REPOSITORY_VARIABLE
#include "builtin.h"
#include "commit.h"
#include "config.h"
diff --git a/builtin/for-each-repo.c b/builtin/for-each-repo.c
index 93d82b9..fae7f91 100644
--- a/builtin/for-each-repo.c
+++ b/builtin/for-each-repo.c
@@ -1,9 +1,9 @@
+#define USE_THE_REPOSITORY_VARIABLE
#include "builtin.h"
#include "config.h"
#include "gettext.h"
#include "parse-options.h"
#include "path.h"
-#include "repository.h"
#include "run-command.h"
#include "string-list.h"
diff --git a/builtin/fsck.c b/builtin/fsck.c
index 87068ce..7f4e2f0 100644
--- a/builtin/fsck.c
+++ b/builtin/fsck.c
@@ -1,7 +1,7 @@
+#define USE_THE_REPOSITORY_VARIABLE
#include "builtin.h"
#include "gettext.h"
#include "hex.h"
-#include "repository.h"
#include "config.h"
#include "commit.h"
#include "tree.h"
diff --git a/builtin/fsmonitor--daemon.c b/builtin/fsmonitor--daemon.c
index 73a4b88..ba8a6ee 100644
--- a/builtin/fsmonitor--daemon.c
+++ b/builtin/fsmonitor--daemon.c
@@ -1,3 +1,4 @@
+#define USE_THE_REPOSITORY_VARIABLE
#include "builtin.h"
#include "abspath.h"
#include "config.h"
@@ -11,7 +12,7 @@
#include "compat/fsmonitor/fsm-health.h"
#include "compat/fsmonitor/fsm-listen.h"
#include "fsmonitor--daemon.h"
-#include "repository.h"
+
#include "simple-ipc.h"
#include "khash.h"
#include "run-command.h"
diff --git a/builtin/gc.c b/builtin/gc.c
index 0727de1..6bc8f7e 100644
--- a/builtin/gc.c
+++ b/builtin/gc.c
@@ -9,13 +9,12 @@
*
* Copyright (c) 2006 Shawn O. Pearce
*/
-
+#define USE_THE_REPOSITORY_VARIABLE
#include "builtin.h"
#include "abspath.h"
#include "date.h"
#include "environment.h"
#include "hex.h"
-#include "repository.h"
#include "config.h"
#include "tempfile.h"
#include "lockfile.h"
diff --git a/builtin/get-tar-commit-id.c b/builtin/get-tar-commit-id.c
index 6bec0d1..272384a 100644
--- a/builtin/get-tar-commit-id.c
+++ b/builtin/get-tar-commit-id.c
@@ -1,6 +1,7 @@
/*
* Copyright (c) 2005, 2006 Rene Scharfe
*/
+#define USE_THE_REPOSITORY_VARIABLE
#include "builtin.h"
#include "commit.h"
#include "tar.h"
diff --git a/builtin/grep.c b/builtin/grep.c
index da11879..bc3439c 100644
--- a/builtin/grep.c
+++ b/builtin/grep.c
@@ -3,11 +3,11 @@
*
* Copyright (c) 2006 Junio C Hamano
*/
+#define USE_THE_REPOSITORY_VARIABLE
#include "builtin.h"
#include "abspath.h"
#include "gettext.h"
#include "hex.h"
-#include "repository.h"
#include "config.h"
#include "tag.h"
#include "tree-walk.h"
diff --git a/builtin/hash-object.c b/builtin/hash-object.c
index 090daea..a25f040 100644
--- a/builtin/hash-object.c
+++ b/builtin/hash-object.c
@@ -4,6 +4,7 @@
* Copyright (C) Linus Torvalds, 2005
* Copyright (C) Junio C Hamano, 2005
*/
+#define USE_THE_REPOSITORY_VARIABLE
#include "builtin.h"
#include "abspath.h"
#include "config.h"
diff --git a/builtin/help.c b/builtin/help.c
index f7723bd..9c4cfe1 100644
--- a/builtin/help.c
+++ b/builtin/help.c
@@ -1,6 +1,8 @@
+
/*
* Builtin help command
*/
+#define USE_THE_REPOSITORY_VARIABLE
#include "builtin.h"
#include "config.h"
#include "exec-cmd.h"
diff --git a/builtin/hook.c b/builtin/hook.c
index f02e242..367ef3e 100644
--- a/builtin/hook.c
+++ b/builtin/hook.c
@@ -1,3 +1,4 @@
+#define USE_THE_REPOSITORY_VARIABLE
#include "builtin.h"
#include "config.h"
#include "gettext.h"
diff --git a/builtin/index-pack.c b/builtin/index-pack.c
index 3207130..3264113 100644
--- a/builtin/index-pack.c
+++ b/builtin/index-pack.c
@@ -1,3 +1,4 @@
+#define USE_THE_REPOSITORY_VARIABLE
#include "builtin.h"
#include "config.h"
#include "delta.h"
diff --git a/builtin/init-db.c b/builtin/init-db.c
index 94bd607..687cada 100644
--- a/builtin/init-db.c
+++ b/builtin/init-db.c
@@ -3,6 +3,7 @@
*
* Copyright (C) Linus Torvalds, 2005
*/
+#define USE_THE_REPOSITORY_VARIABLE
#include "builtin.h"
#include "abspath.h"
#include "environment.h"
@@ -11,7 +12,6 @@
#include "parse-options.h"
#include "path.h"
#include "refs.h"
-#include "repository.h"
#include "setup.h"
#include "strbuf.h"
diff --git a/builtin/interpret-trailers.c b/builtin/interpret-trailers.c
index fb93e54..44f8362 100644
--- a/builtin/interpret-trailers.c
+++ b/builtin/interpret-trailers.c
@@ -4,7 +4,7 @@
* Copyright (c) 2013, 2014 Christian Couder <chriscool@tuxfamily.org>
*
*/
-
+#define USE_THE_REPOSITORY_VARIABLE
#include "builtin.h"
#include "gettext.h"
#include "parse-options.h"
diff --git a/builtin/log.c b/builtin/log.c
index 6714057..e4533a9 100644
--- a/builtin/log.c
+++ b/builtin/log.c
@@ -4,6 +4,7 @@
* (C) Copyright 2006 Linus Torvalds
* 2006 Junio Hamano
*/
+#define USE_THE_REPOSITORY_VARIABLE
#include "builtin.h"
#include "abspath.h"
#include "config.h"
@@ -37,7 +38,7 @@
#include "mailmap.h"
#include "progress.h"
#include "commit-slab.h"
-#include "repository.h"
+
#include "commit-reach.h"
#include "range-diff.h"
#include "tmp-objdir.h"
diff --git a/builtin/ls-files.c b/builtin/ls-files.c
index 7f45cb6..6aaba08 100644
--- a/builtin/ls-files.c
+++ b/builtin/ls-files.c
@@ -5,8 +5,8 @@
*
* Copyright (C) Linus Torvalds, 2005
*/
+#define USE_THE_REPOSITORY_VARIABLE
#include "builtin.h"
-#include "repository.h"
#include "config.h"
#include "convert.h"
#include "quote.h"
diff --git a/builtin/ls-remote.c b/builtin/ls-remote.c
index f2c2854..f723b3b 100644
--- a/builtin/ls-remote.c
+++ b/builtin/ls-remote.c
@@ -1,3 +1,4 @@
+#define USE_THE_REPOSITORY_VARIABLE
#include "builtin.h"
#include "gettext.h"
#include "hex.h"
diff --git a/builtin/ls-tree.c b/builtin/ls-tree.c
index 363cb94..8542b5d 100644
--- a/builtin/ls-tree.c
+++ b/builtin/ls-tree.c
@@ -3,7 +3,9 @@
*
* Copyright (C) Linus Torvalds, 2005
*/
+#define USE_THE_REPOSITORY_VARIABLE
#include "builtin.h"
+
#include "config.h"
#include "gettext.h"
#include "hex.h"
diff --git a/builtin/mailinfo.c b/builtin/mailinfo.c
index 00bfcd1..e17dec2 100644
--- a/builtin/mailinfo.c
+++ b/builtin/mailinfo.c
@@ -2,6 +2,7 @@
* Another stupid program, this one parsing the headers of an
* email to figure out authorship and subject
*/
+#define USE_THE_REPOSITORY_VARIABLE
#include "builtin.h"
#include "abspath.h"
#include "environment.h"
diff --git a/builtin/mailsplit.c b/builtin/mailsplit.c
index b8f7150..2425422 100644
--- a/builtin/mailsplit.c
+++ b/builtin/mailsplit.c
@@ -4,6 +4,7 @@
* It just splits a mbox into a list of files: "0001" "0002" ..
* so you can process them further from there.
*/
+#define USE_THE_REPOSITORY_VARIABLE
#include "builtin.h"
#include "gettext.h"
#include "string-list.h"
diff --git a/builtin/merge-base.c b/builtin/merge-base.c
index afeae8d..a20c93b 100644
--- a/builtin/merge-base.c
+++ b/builtin/merge-base.c
@@ -1,3 +1,4 @@
+#define USE_THE_REPOSITORY_VARIABLE
#include "builtin.h"
#include "config.h"
#include "commit.h"
@@ -5,7 +6,6 @@
#include "hex.h"
#include "object-name.h"
#include "parse-options.h"
-#include "repository.h"
#include "commit-reach.h"
static int show_merge_base(struct commit **rev, int rev_nr, int show_all)
diff --git a/builtin/merge-file.c b/builtin/merge-file.c
index f785813..cb42865 100644
--- a/builtin/merge-file.c
+++ b/builtin/merge-file.c
@@ -1,3 +1,4 @@
+#define USE_THE_REPOSITORY_VARIABLE
#include "builtin.h"
#include "abspath.h"
#include "diff.h"
diff --git a/builtin/merge-index.c b/builtin/merge-index.c
index 1309a8f..a5b87ee 100644
--- a/builtin/merge-index.c
+++ b/builtin/merge-index.c
@@ -1,7 +1,7 @@
+#define USE_THE_REPOSITORY_VARIABLE
#include "builtin.h"
#include "hex.h"
#include "read-cache-ll.h"
-#include "repository.h"
#include "run-command.h"
#include "sparse-index.h"
diff --git a/builtin/merge-ours.c b/builtin/merge-ours.c
index 62267f1..1fcf53f 100644
--- a/builtin/merge-ours.c
+++ b/builtin/merge-ours.c
@@ -7,10 +7,11 @@
*
* Pretend we resolved the heads, but declare our tree trumps everybody else.
*/
+#define USE_THE_REPOSITORY_VARIABLE
#include "git-compat-util.h"
#include "builtin.h"
#include "diff.h"
-#include "repository.h"
+
static const char builtin_merge_ours_usage[] =
"git merge-ours <base>... -- HEAD <remote>...";
diff --git a/builtin/merge-recursive.c b/builtin/merge-recursive.c
index 2bd3fb0..1dd2955 100644
--- a/builtin/merge-recursive.c
+++ b/builtin/merge-recursive.c
@@ -1,10 +1,10 @@
+#define USE_THE_REPOSITORY_VARIABLE
#include "builtin.h"
#include "advice.h"
#include "gettext.h"
#include "hash.h"
#include "merge-recursive.h"
#include "object-name.h"
-#include "repository.h"
static const char builtin_merge_recursive_usage[] =
"git %s <base>... -- <head> <remote> ...";
diff --git a/builtin/merge-tree.c b/builtin/merge-tree.c
index 8751d86..33f9187 100644
--- a/builtin/merge-tree.c
+++ b/builtin/merge-tree.c
@@ -1,3 +1,4 @@
+#define USE_THE_REPOSITORY_VARIABLE
#include "builtin.h"
#include "tree-walk.h"
#include "xdiff-interface.h"
@@ -10,7 +11,6 @@
#include "object-name.h"
#include "object-store-ll.h"
#include "parse-options.h"
-#include "repository.h"
#include "blob.h"
#include "merge-blobs.h"
#include "quote.h"
diff --git a/builtin/merge.c b/builtin/merge.c
index fd6dc00..c54ac7b 100644
--- a/builtin/merge.c
+++ b/builtin/merge.c
@@ -5,8 +5,9 @@
*
* Based on git-merge.sh by Junio C Hamano.
*/
-
+#define USE_THE_REPOSITORY_VARIABLE
#include "builtin.h"
+
#include "abspath.h"
#include "advice.h"
#include "config.h"
diff --git a/builtin/mktag.c b/builtin/mktag.c
index 5cd8a3e..6e188dc 100644
--- a/builtin/mktag.c
+++ b/builtin/mktag.c
@@ -1,3 +1,4 @@
+#define USE_THE_REPOSITORY_VARIABLE
#include "builtin.h"
#include "gettext.h"
#include "hex.h"
diff --git a/builtin/mktree.c b/builtin/mktree.c
index 72a1af1..3c16faa 100644
--- a/builtin/mktree.c
+++ b/builtin/mktree.c
@@ -3,6 +3,7 @@
*
* Copyright (c) Junio C Hamano, 2006, 2009
*/
+#define USE_THE_REPOSITORY_VARIABLE
#include "builtin.h"
#include "gettext.h"
#include "hex.h"
diff --git a/builtin/multi-pack-index.c b/builtin/multi-pack-index.c
index 154fc77..e397723 100644
--- a/builtin/multi-pack-index.c
+++ b/builtin/multi-pack-index.c
@@ -1,3 +1,4 @@
+#define USE_THE_REPOSITORY_VARIABLE
#include "builtin.h"
#include "abspath.h"
#include "config.h"
diff --git a/builtin/mv.c b/builtin/mv.c
index 6e2eb9c..472a278 100644
--- a/builtin/mv.c
+++ b/builtin/mv.c
@@ -3,6 +3,7 @@
*
* Copyright (C) 2006 Johannes Schindelin
*/
+#define USE_THE_REPOSITORY_VARIABLE
#include "builtin.h"
#include "abspath.h"
@@ -18,7 +19,7 @@
#include "string-list.h"
#include "parse-options.h"
#include "read-cache-ll.h"
-#include "repository.h"
+
#include "setup.h"
#include "strvec.h"
#include "submodule.h"
diff --git a/builtin/name-rev.c b/builtin/name-rev.c
index 19d92fb..7f08c38 100644
--- a/builtin/name-rev.c
+++ b/builtin/name-rev.c
@@ -1,8 +1,8 @@
+#define USE_THE_REPOSITORY_VARIABLE
#include "builtin.h"
#include "environment.h"
#include "gettext.h"
#include "hex.h"
-#include "repository.h"
#include "config.h"
#include "commit.h"
#include "tag.h"
diff --git a/builtin/notes.c b/builtin/notes.c
index 49d8364..55ce2eb 100644
--- a/builtin/notes.c
+++ b/builtin/notes.c
@@ -6,7 +6,7 @@
* Based on git-notes.sh by Johannes Schindelin,
* and builtin/tag.c by Kristian Høgsberg and Carlos Rica.
*/
-
+#define USE_THE_REPOSITORY_VARIABLE
#include "builtin.h"
#include "config.h"
#include "editor.h"
@@ -17,7 +17,7 @@
#include "object-name.h"
#include "object-store-ll.h"
#include "path.h"
-#include "repository.h"
+
#include "pretty.h"
#include "refs.h"
#include "exec-cmd.h"
diff --git a/builtin/pack-objects.c b/builtin/pack-objects.c
index 127972f..40c64f3 100644
--- a/builtin/pack-objects.c
+++ b/builtin/pack-objects.c
@@ -1,8 +1,8 @@
+#define USE_THE_REPOSITORY_VARIABLE
#include "builtin.h"
#include "environment.h"
#include "gettext.h"
#include "hex.h"
-#include "repository.h"
#include "config.h"
#include "attr.h"
#include "object.h"
diff --git a/builtin/pack-redundant.c b/builtin/pack-redundant.c
index 84f0d83..81f4494 100644
--- a/builtin/pack-redundant.c
+++ b/builtin/pack-redundant.c
@@ -5,11 +5,12 @@
* This file is licensed under the GPL v2.
*
*/
+#define USE_THE_REPOSITORY_VARIABLE
#include "builtin.h"
#include "gettext.h"
#include "hex.h"
-#include "repository.h"
+
#include "packfile.h"
#include "object-store-ll.h"
diff --git a/builtin/pack-refs.c b/builtin/pack-refs.c
index 67dabb3..2d83c1e 100644
--- a/builtin/pack-refs.c
+++ b/builtin/pack-refs.c
@@ -1,9 +1,9 @@
+#define USE_THE_REPOSITORY_VARIABLE
#include "builtin.h"
#include "config.h"
#include "gettext.h"
#include "parse-options.h"
#include "refs.h"
-#include "repository.h"
#include "revision.h"
static char const * const pack_refs_usage[] = {
diff --git a/builtin/patch-id.c b/builtin/patch-id.c
index fa31a1b..704044c 100644
--- a/builtin/patch-id.c
+++ b/builtin/patch-id.c
@@ -1,3 +1,4 @@
+#define USE_THE_REPOSITORY_VARIABLE
#include "builtin.h"
#include "config.h"
#include "diff.h"
diff --git a/builtin/prune-packed.c b/builtin/prune-packed.c
index 4d63f26..0720d82 100644
--- a/builtin/prune-packed.c
+++ b/builtin/prune-packed.c
@@ -1,3 +1,4 @@
+#define USE_THE_REPOSITORY_VARIABLE
#include "builtin.h"
#include "gettext.h"
#include "parse-options.h"
diff --git a/builtin/prune.c b/builtin/prune.c
index cbd4c38..f439d1b 100644
--- a/builtin/prune.c
+++ b/builtin/prune.c
@@ -1,3 +1,4 @@
+#define USE_THE_REPOSITORY_VARIABLE
#include "builtin.h"
#include "commit.h"
#include "diff.h"
diff --git a/builtin/pull.c b/builtin/pull.c
index 1a926f0..149f201 100644
--- a/builtin/pull.c
+++ b/builtin/pull.c
@@ -6,6 +6,7 @@
* Fetch one or more remote refs and merge it/them into the current HEAD.
*/
+#define USE_THE_REPOSITORY_VARIABLE
#include "builtin.h"
#include "advice.h"
#include "config.h"
diff --git a/builtin/push.c b/builtin/push.c
index 9636ad5..238cd5d 100644
--- a/builtin/push.c
+++ b/builtin/push.c
@@ -1,6 +1,7 @@
/*
* "git push"
*/
+#define USE_THE_REPOSITORY_VARIABLE
#include "builtin.h"
#include "advice.h"
#include "branch.h"
@@ -13,7 +14,6 @@
#include "transport.h"
#include "parse-options.h"
#include "pkt-line.h"
-#include "repository.h"
#include "submodule.h"
#include "submodule-config.h"
#include "send-pack.h"
diff --git a/builtin/range-diff.c b/builtin/range-diff.c
index 3e67259..1b33ab6 100644
--- a/builtin/range-diff.c
+++ b/builtin/range-diff.c
@@ -1,10 +1,11 @@
+#define USE_THE_REPOSITORY_VARIABLE
#include "builtin.h"
#include "gettext.h"
#include "object-name.h"
#include "parse-options.h"
#include "range-diff.h"
#include "config.h"
-#include "repository.h"
+
static const char * const builtin_range_diff_usage[] = {
N_("git range-diff [<options>] <old-base>..<old-tip> <new-base>..<new-tip>"),
diff --git a/builtin/read-tree.c b/builtin/read-tree.c
index 89410db..d2a807a 100644
--- a/builtin/read-tree.c
+++ b/builtin/read-tree.c
@@ -3,7 +3,7 @@
*
* Copyright (C) Linus Torvalds, 2005
*/
-
+#define USE_THE_REPOSITORY_VARIABLE
#include "builtin.h"
#include "config.h"
#include "gettext.h"
@@ -16,7 +16,6 @@
#include "cache-tree.h"
#include "unpack-trees.h"
#include "parse-options.h"
-#include "repository.h"
#include "resolve-undo.h"
#include "setup.h"
#include "sparse-index.h"
diff --git a/builtin/rebase.c b/builtin/rebase.c
index 727d9df..d2ad7d0 100644
--- a/builtin/rebase.c
+++ b/builtin/rebase.c
@@ -3,8 +3,9 @@
*
* Copyright (c) 2018 Pratik Karki
*/
-
+#define USE_THE_REPOSITORY_VARIABLE
#include "builtin.h"
+
#include "abspath.h"
#include "environment.h"
#include "gettext.h"
diff --git a/builtin/receive-pack.c b/builtin/receive-pack.c
index 36a6229..c4b766c 100644
--- a/builtin/receive-pack.c
+++ b/builtin/receive-pack.c
@@ -1,6 +1,7 @@
+#define USE_THE_REPOSITORY_VARIABLE
#include "builtin.h"
#include "abspath.h"
-#include "repository.h"
+
#include "config.h"
#include "environment.h"
#include "gettext.h"
diff --git a/builtin/reflog.c b/builtin/reflog.c
index 6250f5a..22df683 100644
--- a/builtin/reflog.c
+++ b/builtin/reflog.c
@@ -1,7 +1,7 @@
+#define USE_THE_REPOSITORY_VARIABLE
#include "builtin.h"
#include "config.h"
#include "gettext.h"
-#include "repository.h"
#include "revision.h"
#include "reachable.h"
#include "wildmatch.h"
diff --git a/builtin/refs.c b/builtin/refs.c
index 70bca72..24978a7 100644
--- a/builtin/refs.c
+++ b/builtin/refs.c
@@ -1,9 +1,9 @@
+#define USE_THE_REPOSITORY_VARIABLE
#include "builtin.h"
#include "config.h"
#include "fsck.h"
#include "parse-options.h"
#include "refs.h"
-#include "repository.h"
#include "strbuf.h"
#define REFS_MIGRATE_USAGE \
diff --git a/builtin/remote-ext.c b/builtin/remote-ext.c
index 33c8ae0..119f338 100644
--- a/builtin/remote-ext.c
+++ b/builtin/remote-ext.c
@@ -1,3 +1,4 @@
+#define USE_THE_REPOSITORY_VARIABLE
#include "builtin.h"
#include "transport.h"
#include "run-command.h"
diff --git a/builtin/remote-fd.c b/builtin/remote-fd.c
index ae896ed..b27ea81 100644
--- a/builtin/remote-fd.c
+++ b/builtin/remote-fd.c
@@ -1,3 +1,4 @@
+#define USE_THE_REPOSITORY_VARIABLE
#include "builtin.h"
#include "transport.h"
diff --git a/builtin/remote.c b/builtin/remote.c
index 1ac7e5f..61a82e5 100644
--- a/builtin/remote.c
+++ b/builtin/remote.c
@@ -1,3 +1,4 @@
+#define USE_THE_REPOSITORY_VARIABLE
#include "builtin.h"
#include "config.h"
#include "gettext.h"
diff --git a/builtin/repack.c b/builtin/repack.c
index a6f2a4d..1e2286d 100644
--- a/builtin/repack.c
+++ b/builtin/repack.c
@@ -1,3 +1,4 @@
+#define USE_THE_REPOSITORY_VARIABLE
#include "builtin.h"
#include "config.h"
#include "dir.h"
diff --git a/builtin/replace.c b/builtin/replace.c
index 293ae6d..2daed94 100644
--- a/builtin/replace.c
+++ b/builtin/replace.c
@@ -7,7 +7,7 @@
* and Carlos Rica <jasampler@gmail.com> that was itself based on
* git-tag.sh and mktag.c by Linus Torvalds.
*/
-
+#define USE_THE_REPOSITORY_VARIABLE
#include "builtin.h"
#include "config.h"
#include "editor.h"
@@ -22,7 +22,6 @@
#include "object-name.h"
#include "object-store-ll.h"
#include "replace-object.h"
-#include "repository.h"
#include "tag.h"
#include "wildmatch.h"
diff --git a/builtin/replay.c b/builtin/replay.c
index c8e9098..2d12a4e 100644
--- a/builtin/replay.c
+++ b/builtin/replay.c
@@ -4,6 +4,7 @@
#include "git-compat-util.h"
+#define USE_THE_REPOSITORY_VARIABLE
#include "builtin.h"
#include "environment.h"
#include "hex.h"
diff --git a/builtin/rerere.c b/builtin/rerere.c
index ae34515..f7143c3 100644
--- a/builtin/rerere.c
+++ b/builtin/rerere.c
@@ -1,8 +1,9 @@
+#define USE_THE_REPOSITORY_VARIABLE
#include "builtin.h"
#include "config.h"
#include "gettext.h"
#include "parse-options.h"
-#include "repository.h"
+
#include "string-list.h"
#include "rerere.h"
#include "xdiff/xdiff.h"
diff --git a/builtin/reset.c b/builtin/reset.c
index 7552907..cb054c2 100644
--- a/builtin/reset.c
+++ b/builtin/reset.c
@@ -7,7 +7,7 @@
*
* Copyright (c) 2005, 2006 Linus Torvalds and Junio C Hamano
*/
-
+#define USE_THE_REPOSITORY_VARIABLE
#include "builtin.h"
#include "advice.h"
#include "config.h"
diff --git a/builtin/rev-list.c b/builtin/rev-list.c
index a4186d4..f62bcbf 100644
--- a/builtin/rev-list.c
+++ b/builtin/rev-list.c
@@ -1,3 +1,4 @@
+#define USE_THE_REPOSITORY_VARIABLE
#include "builtin.h"
#include "config.h"
#include "commit.h"
diff --git a/builtin/rev-parse.c b/builtin/rev-parse.c
index 26190aa..f2d90f6 100644
--- a/builtin/rev-parse.c
+++ b/builtin/rev-parse.c
@@ -3,8 +3,9 @@
*
* Copyright (C) Linus Torvalds, 2005
*/
-
+#define USE_THE_REPOSITORY_VARIABLE
#include "builtin.h"
+
#include "abspath.h"
#include "config.h"
#include "commit.h"
diff --git a/builtin/revert.c b/builtin/revert.c
index 5f2ec3a..55ba109 100644
--- a/builtin/revert.c
+++ b/builtin/revert.c
@@ -1,9 +1,9 @@
+#define USE_THE_REPOSITORY_VARIABLE
#include "git-compat-util.h"
#include "builtin.h"
#include "parse-options.h"
#include "diff.h"
#include "gettext.h"
-#include "repository.h"
#include "revision.h"
#include "rerere.h"
#include "sequencer.h"
diff --git a/builtin/rm.c b/builtin/rm.c
index 59077ef..eaff027 100644
--- a/builtin/rm.c
+++ b/builtin/rm.c
@@ -3,7 +3,7 @@
*
* Copyright (C) Linus Torvalds 2006
*/
-
+#define USE_THE_REPOSITORY_VARIABLE
#include "builtin.h"
#include "advice.h"
#include "config.h"
@@ -15,7 +15,7 @@
#include "object-name.h"
#include "parse-options.h"
#include "read-cache.h"
-#include "repository.h"
+
#include "string-list.h"
#include "setup.h"
#include "sparse-index.h"
diff --git a/builtin/send-pack.c b/builtin/send-pack.c
index a4925ed..4fd3cb8 100644
--- a/builtin/send-pack.c
+++ b/builtin/send-pack.c
@@ -1,3 +1,4 @@
+#define USE_THE_REPOSITORY_VARIABLE
#include "builtin.h"
#include "config.h"
#include "hex.h"
diff --git a/builtin/shortlog.c b/builtin/shortlog.c
index 70eb789..3ed5c46 100644
--- a/builtin/shortlog.c
+++ b/builtin/shortlog.c
@@ -1,3 +1,4 @@
+#define USE_THE_REPOSITORY_VARIABLE
#include "builtin.h"
#include "config.h"
#include "commit.h"
@@ -5,7 +6,6 @@
#include "environment.h"
#include "gettext.h"
#include "string-list.h"
-#include "repository.h"
#include "revision.h"
#include "utf8.h"
#include "mailmap.h"
diff --git a/builtin/show-branch.c b/builtin/show-branch.c
index 05c1062..cd6bdf6 100644
--- a/builtin/show-branch.c
+++ b/builtin/show-branch.c
@@ -1,3 +1,4 @@
+#define USE_THE_REPOSITORY_VARIABLE
#include "builtin.h"
#include "config.h"
#include "environment.h"
@@ -10,7 +11,7 @@
#include "strvec.h"
#include "object-name.h"
#include "parse-options.h"
-#include "repository.h"
+
#include "dir.h"
#include "commit-slab.h"
#include "date.h"
diff --git a/builtin/show-index.c b/builtin/show-index.c
index 9e1f7ac..f164c01 100644
--- a/builtin/show-index.c
+++ b/builtin/show-index.c
@@ -1,10 +1,10 @@
+#define USE_THE_REPOSITORY_VARIABLE
#include "builtin.h"
#include "gettext.h"
#include "hash.h"
#include "hex.h"
#include "pack.h"
#include "parse-options.h"
-#include "repository.h"
static const char *const show_index_usage[] = {
"git show-index [--object-format=<hash-algorithm>]",
diff --git a/builtin/show-ref.c b/builtin/show-ref.c
index 6ee05f0..285cd3e 100644
--- a/builtin/show-ref.c
+++ b/builtin/show-ref.c
@@ -1,3 +1,4 @@
+#define USE_THE_REPOSITORY_VARIABLE
#include "builtin.h"
#include "config.h"
#include "gettext.h"
diff --git a/builtin/sparse-checkout.c b/builtin/sparse-checkout.c
index 23f1548..5e930e5 100644
--- a/builtin/sparse-checkout.c
+++ b/builtin/sparse-checkout.c
@@ -1,3 +1,4 @@
+#define USE_THE_REPOSITORY_VARIABLE
#include "builtin.h"
#include "config.h"
#include "dir.h"
@@ -7,7 +8,6 @@
#include "object-name.h"
#include "parse-options.h"
#include "pathspec.h"
-#include "repository.h"
#include "strbuf.h"
#include "string-list.h"
#include "lockfile.h"
diff --git a/builtin/stash.c b/builtin/stash.c
index 518d297..461cfae 100644
--- a/builtin/stash.c
+++ b/builtin/stash.c
@@ -1,3 +1,4 @@
+#define USE_THE_REPOSITORY_VARIABLE
#include "builtin.h"
#include "abspath.h"
#include "config.h"
diff --git a/builtin/stripspace.c b/builtin/stripspace.c
index 674ef93..e147f3f 100644
--- a/builtin/stripspace.c
+++ b/builtin/stripspace.c
@@ -1,3 +1,4 @@
+#define USE_THE_REPOSITORY_VARIABLE
#include "builtin.h"
#include "config.h"
#include "environment.h"
diff --git a/builtin/submodule--helper.c b/builtin/submodule--helper.c
index 947bd9d..b83d44b 100644
--- a/builtin/submodule--helper.c
+++ b/builtin/submodule--helper.c
@@ -1,9 +1,10 @@
+#define USE_THE_REPOSITORY_VARIABLE
#include "builtin.h"
#include "abspath.h"
#include "environment.h"
#include "gettext.h"
#include "hex.h"
-#include "repository.h"
+
#include "config.h"
#include "parse-options.h"
#include "quote.h"
diff --git a/builtin/symbolic-ref.c b/builtin/symbolic-ref.c
index 9bc7022..299d23d 100644
--- a/builtin/symbolic-ref.c
+++ b/builtin/symbolic-ref.c
@@ -1,3 +1,4 @@
+#define USE_THE_REPOSITORY_VARIABLE
#include "builtin.h"
#include "config.h"
#include "gettext.h"
diff --git a/builtin/tag.c b/builtin/tag.c
index a80838e..ca2166e 100644
--- a/builtin/tag.c
+++ b/builtin/tag.c
@@ -5,7 +5,7 @@
* Carlos Rica <jasampler@gmail.com>
* Based on git-tag.sh and mktag.c by Linus Torvalds.
*/
-
+#define USE_THE_REPOSITORY_VARIABLE
#include "builtin.h"
#include "advice.h"
#include "config.h"
diff --git a/builtin/unpack-file.c b/builtin/unpack-file.c
index 9788684..6da2825 100644
--- a/builtin/unpack-file.c
+++ b/builtin/unpack-file.c
@@ -1,3 +1,4 @@
+#define USE_THE_REPOSITORY_VARIABLE
#include "builtin.h"
#include "config.h"
#include "hex.h"
diff --git a/builtin/unpack-objects.c b/builtin/unpack-objects.c
index 3bcdaae..02b8d02 100644
--- a/builtin/unpack-objects.c
+++ b/builtin/unpack-objects.c
@@ -1,3 +1,4 @@
+#define USE_THE_REPOSITORY_VARIABLE
#include "builtin.h"
#include "bulk-checkin.h"
#include "config.h"
diff --git a/builtin/update-index.c b/builtin/update-index.c
index 1d1d87d..a1a98aa 100644
--- a/builtin/update-index.c
+++ b/builtin/update-index.c
@@ -3,7 +3,7 @@
*
* Copyright (C) Linus Torvalds, 2005
*/
-
+#define USE_THE_REPOSITORY_VARIABLE
#include "builtin.h"
#include "bulk-checkin.h"
#include "config.h"
@@ -22,7 +22,6 @@
#include "pathspec.h"
#include "dir.h"
#include "read-cache.h"
-#include "repository.h"
#include "setup.h"
#include "sparse-index.h"
#include "split-index.h"
diff --git a/builtin/update-ref.c b/builtin/update-ref.c
index 06826a9..8a98615 100644
--- a/builtin/update-ref.c
+++ b/builtin/update-ref.c
@@ -1,3 +1,4 @@
+#define USE_THE_REPOSITORY_VARIABLE
#include "builtin.h"
#include "config.h"
#include "gettext.h"
@@ -6,7 +7,6 @@
#include "object-name.h"
#include "parse-options.h"
#include "quote.h"
-#include "repository.h"
static const char * const git_update_ref_usage[] = {
N_("git update-ref [<options>] -d <refname> [<old-oid>]"),
diff --git a/builtin/update-server-info.c b/builtin/update-server-info.c
index a5b7d86..6769611 100644
--- a/builtin/update-server-info.c
+++ b/builtin/update-server-info.c
@@ -1,3 +1,4 @@
+#define USE_THE_REPOSITORY_VARIABLE
#include "builtin.h"
#include "config.h"
#include "gettext.h"
diff --git a/builtin/upload-archive.c b/builtin/upload-archive.c
index 49d1bb7..6f2ddbd 100644
--- a/builtin/upload-archive.c
+++ b/builtin/upload-archive.c
@@ -1,12 +1,12 @@
/*
* Copyright (c) 2006 Franck Bui-Huu
*/
+#define USE_THE_REPOSITORY_VARIABLE
#include "builtin.h"
#include "archive.h"
#include "path.h"
#include "pkt-line.h"
#include "sideband.h"
-#include "repository.h"
#include "run-command.h"
#include "strvec.h"
diff --git a/builtin/upload-pack.c b/builtin/upload-pack.c
index 3b6c83f..363091c 100644
--- a/builtin/upload-pack.c
+++ b/builtin/upload-pack.c
@@ -1,3 +1,4 @@
+#define USE_THE_REPOSITORY_VARIABLE
#include "builtin.h"
#include "exec-cmd.h"
#include "gettext.h"
diff --git a/builtin/var.c b/builtin/var.c
index 4a5c264..2ecaed5 100644
--- a/builtin/var.c
+++ b/builtin/var.c
@@ -3,7 +3,9 @@
*
* Copyright (C) Eric Biederman, 2005
*/
+#define USE_THE_REPOSITORY_VARIABLE
#include "builtin.h"
+
#include "attr.h"
#include "config.h"
#include "editor.h"
diff --git a/builtin/verify-commit.c b/builtin/verify-commit.c
index c5859e5..779b798 100644
--- a/builtin/verify-commit.c
+++ b/builtin/verify-commit.c
@@ -5,11 +5,11 @@
*
* Based on git-verify-tag
*/
+#define USE_THE_REPOSITORY_VARIABLE
#include "builtin.h"
#include "config.h"
#include "gettext.h"
#include "object-name.h"
-#include "repository.h"
#include "commit.h"
#include "parse-options.h"
#include "gpg-interface.h"
diff --git a/builtin/verify-pack.c b/builtin/verify-pack.c
index 7ad4566..34e4ed7 100644
--- a/builtin/verify-pack.c
+++ b/builtin/verify-pack.c
@@ -1,3 +1,4 @@
+#define USE_THE_REPOSITORY_VARIABLE
#include "builtin.h"
#include "config.h"
#include "gettext.h"
diff --git a/builtin/verify-tag.c b/builtin/verify-tag.c
index a7bef52..f6b9704 100644
--- a/builtin/verify-tag.c
+++ b/builtin/verify-tag.c
@@ -5,6 +5,7 @@
*
* Based on git-verify-tag.sh
*/
+#define USE_THE_REPOSITORY_VARIABLE
#include "builtin.h"
#include "config.h"
#include "gettext.h"
diff --git a/builtin/worktree.c b/builtin/worktree.c
index 3b47f98..c22b2e9 100644
--- a/builtin/worktree.c
+++ b/builtin/worktree.c
@@ -1,3 +1,4 @@
+#define USE_THE_REPOSITORY_VARIABLE
#include "builtin.h"
#include "abspath.h"
#include "advice.h"
@@ -17,7 +18,6 @@
#include "read-cache-ll.h"
#include "refs.h"
#include "remote.h"
-#include "repository.h"
#include "run-command.h"
#include "hook.h"
#include "sigchain.h"
diff --git a/builtin/write-tree.c b/builtin/write-tree.c
index 1b467d6..de4ebf7 100644
--- a/builtin/write-tree.c
+++ b/builtin/write-tree.c
@@ -3,7 +3,7 @@
*
* Copyright (C) Linus Torvalds, 2005
*/
-
+#define USE_THE_REPOSITORY_VARIABLE
#include "builtin.h"
#include "config.h"
#include "environment.h"
@@ -12,7 +12,6 @@
#include "tree.h"
#include "cache-tree.h"
#include "parse-options.h"
-#include "repository.h"
static const char * const write_tree_usage[] = {
N_("git write-tree [--missing-ok] [--prefix=<prefix>/]"),