Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'builtin')
-rw-r--r--builtin/am.c1
-rw-r--r--builtin/bisect.c1
-rw-r--r--builtin/blame.c4
-rw-r--r--builtin/cat-file.c4
-rw-r--r--builtin/check-mailmap.c1
-rw-r--r--builtin/checkout--worker.c1
-rw-r--r--builtin/checkout.c1
-rw-r--r--builtin/clone.c1
-rw-r--r--builtin/commit-graph.c2
-rw-r--r--builtin/commit-tree.c1
-rw-r--r--builtin/config.c3
-rw-r--r--builtin/credential-cache--daemon.c4
-rw-r--r--builtin/describe.c1
-rw-r--r--builtin/diff-tree.c1
-rw-r--r--builtin/difftool.c1
-rw-r--r--builtin/fast-export.c1
-rw-r--r--builtin/fast-import.c1
-rw-r--r--builtin/fetch-pack.c2
-rw-r--r--builtin/fetch.c4
-rw-r--r--builtin/fsck.c95
-rw-r--r--builtin/fsmonitor--daemon.c1
-rw-r--r--builtin/gc.c1
-rw-r--r--builtin/grep.c2
-rw-r--r--builtin/hash-object.c1
-rw-r--r--builtin/index-pack.c3
-rw-r--r--builtin/log.c6
-rw-r--r--builtin/ls-remote.c1
-rw-r--r--builtin/ls-tree.c1
-rw-r--r--builtin/merge-base.c1
-rw-r--r--builtin/merge-index.c1
-rw-r--r--builtin/merge-tree.c1
-rw-r--r--builtin/merge.c2
-rw-r--r--builtin/mktag.c1
-rw-r--r--builtin/mktree.c2
-rw-r--r--builtin/mv.c1
-rw-r--r--builtin/name-rev.c3
-rw-r--r--builtin/notes.c1
-rw-r--r--builtin/pack-objects.c4
-rw-r--r--builtin/pack-redundant.c1
-rw-r--r--builtin/patch-id.c1
-rw-r--r--builtin/prune.c2
-rw-r--r--builtin/pull.c1
-rw-r--r--builtin/read-tree.c11
-rw-r--r--builtin/rebase.c1
-rw-r--r--builtin/receive-pack.c1
-rw-r--r--builtin/repack.c3
-rw-r--r--builtin/replace.c2
-rw-r--r--builtin/reset.c1
-rw-r--r--builtin/rev-list.c1
-rw-r--r--builtin/rev-parse.c2
-rw-r--r--builtin/revert.c3
-rw-r--r--builtin/rm.c1
-rw-r--r--builtin/send-pack.c1
-rw-r--r--builtin/show-branch.c1
-rw-r--r--builtin/show-index.c1
-rw-r--r--builtin/show-ref.c1
-rw-r--r--builtin/sparse-checkout.c4
-rw-r--r--builtin/stash.c1
-rw-r--r--builtin/submodule--helper.c2
-rw-r--r--builtin/tag.c1
-rw-r--r--builtin/unpack-file.c1
-rw-r--r--builtin/unpack-objects.c2
-rw-r--r--builtin/update-index.c1
-rw-r--r--builtin/upload-pack.c1
-rw-r--r--builtin/var.c1
-rw-r--r--builtin/worktree.c1
-rw-r--r--builtin/write-tree.c1
67 files changed, 168 insertions, 46 deletions
diff --git a/builtin/am.c b/builtin/am.c
index e0848ddadf..3b5ea50cc5 100644
--- a/builtin/am.c
+++ b/builtin/am.c
@@ -8,6 +8,7 @@
#include "config.h"
#include "builtin.h"
#include "exec-cmd.h"
+#include "hex.h"
#include "parse-options.h"
#include "dir.h"
#include "run-command.h"
diff --git a/builtin/bisect.c b/builtin/bisect.c
index 7301740267..e8ee4a4dc8 100644
--- a/builtin/bisect.c
+++ b/builtin/bisect.c
@@ -1,5 +1,6 @@
#include "builtin.h"
#include "cache.h"
+#include "hex.h"
#include "parse-options.h"
#include "bisect.h"
#include "refs.h"
diff --git a/builtin/blame.c b/builtin/blame.c
index 71f925e456..fdd9f0c0fc 100644
--- a/builtin/blame.c
+++ b/builtin/blame.c
@@ -5,10 +5,12 @@
* See COPYING for licensing conditions
*/
-#include "cache.h"
+#include "git-compat-util.h"
+#include "alloc.h"
#include "config.h"
#include "color.h"
#include "builtin.h"
+#include "hex.h"
#include "repository.h"
#include "commit.h"
#include "diff.h"
diff --git a/builtin/cat-file.c b/builtin/cat-file.c
index 0dec21c107..9e7e03ade4 100644
--- a/builtin/cat-file.c
+++ b/builtin/cat-file.c
@@ -5,9 +5,12 @@
*/
#define USE_THE_INDEX_VARIABLE
#include "cache.h"
+#include "alloc.h"
#include "config.h"
#include "builtin.h"
#include "diff.h"
+#include "hex.h"
+#include "ident.h"
#include "parse-options.h"
#include "userdiff.h"
#include "streaming.h"
@@ -15,6 +18,7 @@
#include "oid-array.h"
#include "packfile.h"
#include "object-store.h"
+#include "replace-object.h"
#include "promisor-remote.h"
#include "mailmap.h"
diff --git a/builtin/check-mailmap.c b/builtin/check-mailmap.c
index 7dc47e4793..96db3ddb4b 100644
--- a/builtin/check-mailmap.c
+++ b/builtin/check-mailmap.c
@@ -1,5 +1,6 @@
#include "builtin.h"
#include "config.h"
+#include "ident.h"
#include "mailmap.h"
#include "parse-options.h"
#include "string-list.h"
diff --git a/builtin/checkout--worker.c b/builtin/checkout--worker.c
index ede7dc32a4..0a7d762573 100644
--- a/builtin/checkout--worker.c
+++ b/builtin/checkout--worker.c
@@ -1,4 +1,5 @@
#include "builtin.h"
+#include "alloc.h"
#include "config.h"
#include "entry.h"
#include "parallel-checkout.h"
diff --git a/builtin/checkout.c b/builtin/checkout.c
index a5155cf55c..21a4335abb 100644
--- a/builtin/checkout.c
+++ b/builtin/checkout.c
@@ -9,6 +9,7 @@
#include "config.h"
#include "diff.h"
#include "dir.h"
+#include "hex.h"
#include "hook.h"
#include "ll-merge.h"
#include "lockfile.h"
diff --git a/builtin/clone.c b/builtin/clone.c
index 65b5b7db6d..462c286274 100644
--- a/builtin/clone.c
+++ b/builtin/clone.c
@@ -11,6 +11,7 @@
#define USE_THE_INDEX_VARIABLE
#include "builtin.h"
#include "config.h"
+#include "hex.h"
#include "lockfile.h"
#include "parse-options.h"
#include "fetch-pack.h"
diff --git a/builtin/commit-graph.c b/builtin/commit-graph.c
index 93704f95a9..d3be7f3b31 100644
--- a/builtin/commit-graph.c
+++ b/builtin/commit-graph.c
@@ -1,12 +1,14 @@
#include "builtin.h"
#include "config.h"
#include "dir.h"
+#include "hex.h"
#include "lockfile.h"
#include "parse-options.h"
#include "repository.h"
#include "commit-graph.h"
#include "object-store.h"
#include "progress.h"
+#include "replace-object.h"
#include "tag.h"
#define BUILTIN_COMMIT_GRAPH_VERIFY_USAGE \
diff --git a/builtin/commit-tree.c b/builtin/commit-tree.c
index cc8d584be2..fefeed5d4b 100644
--- a/builtin/commit-tree.c
+++ b/builtin/commit-tree.c
@@ -5,6 +5,7 @@
*/
#include "cache.h"
#include "config.h"
+#include "hex.h"
#include "object-store.h"
#include "repository.h"
#include "commit.h"
diff --git a/builtin/config.c b/builtin/config.c
index 060cf9f3e0..49d832d409 100644
--- a/builtin/config.c
+++ b/builtin/config.c
@@ -1,7 +1,8 @@
#include "builtin.h"
-#include "cache.h"
+#include "alloc.h"
#include "config.h"
#include "color.h"
+#include "ident.h"
#include "parse-options.h"
#include "urlmatch.h"
#include "quote.h"
diff --git a/builtin/credential-cache--daemon.c b/builtin/credential-cache--daemon.c
index f3c89831d4..6e509d02c3 100644
--- a/builtin/credential-cache--daemon.c
+++ b/builtin/credential-cache--daemon.c
@@ -1,4 +1,5 @@
#include "builtin.h"
+#include "alloc.h"
#include "parse-options.h"
#ifndef NO_UNIX_SOCKETS
@@ -127,6 +128,9 @@ static void serve_one_client(FILE *in, FILE *out)
if (e) {
fprintf(out, "username=%s\n", e->item.username);
fprintf(out, "password=%s\n", e->item.password);
+ if (e->item.password_expiry_utc != TIME_MAX)
+ fprintf(out, "password_expiry_utc=%"PRItime"\n",
+ e->item.password_expiry_utc);
}
}
else if (!strcmp(action.buf, "exit")) {
diff --git a/builtin/describe.c b/builtin/describe.c
index eea1e330c0..5b5930f5c8 100644
--- a/builtin/describe.c
+++ b/builtin/describe.c
@@ -1,6 +1,7 @@
#define USE_THE_INDEX_VARIABLE
#include "cache.h"
#include "config.h"
+#include "hex.h"
#include "lockfile.h"
#include "commit.h"
#include "tag.h"
diff --git a/builtin/diff-tree.c b/builtin/diff-tree.c
index 25b853b85c..a393efa4f0 100644
--- a/builtin/diff-tree.c
+++ b/builtin/diff-tree.c
@@ -3,6 +3,7 @@
#include "config.h"
#include "diff.h"
#include "commit.h"
+#include "hex.h"
#include "log-tree.h"
#include "builtin.h"
#include "submodule.h"
diff --git a/builtin/difftool.c b/builtin/difftool.c
index dbbfb19f19..01681d0fb8 100644
--- a/builtin/difftool.c
+++ b/builtin/difftool.c
@@ -17,6 +17,7 @@
#include "builtin.h"
#include "run-command.h"
#include "exec-cmd.h"
+#include "hex.h"
#include "parse-options.h"
#include "strvec.h"
#include "strbuf.h"
diff --git a/builtin/fast-export.c b/builtin/fast-export.c
index 39a890fc00..78493c6d2b 100644
--- a/builtin/fast-export.c
+++ b/builtin/fast-export.c
@@ -6,6 +6,7 @@
#include "builtin.h"
#include "cache.h"
#include "config.h"
+#include "hex.h"
#include "refs.h"
#include "refspec.h"
#include "object-store.h"
diff --git a/builtin/fast-import.c b/builtin/fast-import.c
index 4a8c835062..f7548ff4a3 100644
--- a/builtin/fast-import.c
+++ b/builtin/fast-import.c
@@ -1,5 +1,6 @@
#include "builtin.h"
#include "cache.h"
+#include "hex.h"
#include "repository.h"
#include "config.h"
#include "lockfile.h"
diff --git a/builtin/fetch-pack.c b/builtin/fetch-pack.c
index afe679368d..702c9a3397 100644
--- a/builtin/fetch-pack.c
+++ b/builtin/fetch-pack.c
@@ -1,4 +1,6 @@
#include "builtin.h"
+#include "alloc.h"
+#include "hex.h"
#include "pkt-line.h"
#include "fetch-pack.h"
#include "remote.h"
diff --git a/builtin/fetch.c b/builtin/fetch.c
index c6b1845429..c98cd0efed 100644
--- a/builtin/fetch.c
+++ b/builtin/fetch.c
@@ -3,6 +3,7 @@
*/
#include "cache.h"
#include "config.h"
+#include "hex.h"
#include "repository.h"
#include "refs.h"
#include "refspec.h"
@@ -2198,6 +2199,9 @@ int cmd_fetch(int argc, const char **argv, const char *prefix)
if (dry_run)
write_fetch_head = 0;
+ if (!max_jobs)
+ max_jobs = online_cpus();
+
if (!git_config_get_string_tmp("fetch.bundleuri", &bundle_uri) &&
fetch_bundle_uri(the_repository, bundle_uri, NULL))
warning(_("failed to fetch bundles from '%s'"), bundle_uri);
diff --git a/builtin/fsck.c b/builtin/fsck.c
index 56aba054ed..c4a633c032 100644
--- a/builtin/fsck.c
+++ b/builtin/fsck.c
@@ -1,6 +1,6 @@
-#define USE_THE_INDEX_VARIABLE
#include "builtin.h"
#include "cache.h"
+#include "hex.h"
#include "repository.h"
#include "config.h"
#include "commit.h"
@@ -19,6 +19,7 @@
#include "decorate.h"
#include "packfile.h"
#include "object-store.h"
+#include "replace-object.h"
#include "resolve-undo.h"
#include "run-command.h"
#include "worktree.h"
@@ -733,19 +734,19 @@ static int fsck_head_link(const char *head_ref_name,
return 0;
}
-static int fsck_cache_tree(struct cache_tree *it)
+static int fsck_cache_tree(struct cache_tree *it, const char *index_path)
{
int i;
int err = 0;
if (verbose)
- fprintf_ln(stderr, _("Checking cache tree"));
+ fprintf_ln(stderr, _("Checking cache tree of %s"), index_path);
if (0 <= it->entry_count) {
struct object *obj = parse_object(the_repository, &it->oid);
if (!obj) {
- error(_("%s: invalid sha1 pointer in cache-tree"),
- oid_to_hex(&it->oid));
+ error(_("%s: invalid sha1 pointer in cache-tree of %s"),
+ oid_to_hex(&it->oid), index_path);
errors_found |= ERROR_REFS;
return 1;
}
@@ -756,11 +757,12 @@ static int fsck_cache_tree(struct cache_tree *it)
err |= objerror(obj, _("non-tree in cache-tree"));
}
for (i = 0; i < it->subtree_nr; i++)
- err |= fsck_cache_tree(it->down[i]->cache_tree);
+ err |= fsck_cache_tree(it->down[i]->cache_tree, index_path);
return err;
}
-static int fsck_resolve_undo(struct index_state *istate)
+static int fsck_resolve_undo(struct index_state *istate,
+ const char *index_path)
{
struct string_list_item *item;
struct string_list *resolve_undo = istate->resolve_undo;
@@ -783,8 +785,9 @@ static int fsck_resolve_undo(struct index_state *istate)
obj = parse_object(the_repository, &ru->oid[i]);
if (!obj) {
- error(_("%s: invalid sha1 pointer in resolve-undo"),
- oid_to_hex(&ru->oid[i]));
+ error(_("%s: invalid sha1 pointer in resolve-undo of %s"),
+ oid_to_hex(&ru->oid[i]),
+ index_path);
errors_found |= ERROR_REFS;
continue;
}
@@ -797,6 +800,38 @@ static int fsck_resolve_undo(struct index_state *istate)
return 0;
}
+static void fsck_index(struct index_state *istate, const char *index_path,
+ int is_main_index)
+{
+ unsigned int i;
+
+ /* TODO: audit for interaction with sparse-index. */
+ ensure_full_index(istate);
+ for (i = 0; i < istate->cache_nr; i++) {
+ unsigned int mode;
+ struct blob *blob;
+ struct object *obj;
+
+ mode = istate->cache[i]->ce_mode;
+ if (S_ISGITLINK(mode))
+ continue;
+ blob = lookup_blob(the_repository,
+ &istate->cache[i]->oid);
+ if (!blob)
+ continue;
+ obj = &blob->object;
+ obj->flags |= USED;
+ fsck_put_object_name(&fsck_walk_options, &obj->oid,
+ "%s:%s",
+ is_main_index ? "" : index_path,
+ istate->cache[i]->name);
+ mark_object_reachable(obj);
+ }
+ if (istate->cache_tree)
+ fsck_cache_tree(istate->cache_tree, index_path);
+ fsck_resolve_undo(istate, index_path);
+}
+
static void mark_object_for_connectivity(const struct object_id *oid)
{
struct object *obj = lookup_unknown_object(the_repository, oid);
@@ -957,32 +992,30 @@ int cmd_fsck(int argc, const char **argv, const char *prefix)
}
if (keep_cache_objects) {
+ struct worktree **worktrees, **p;
+
verify_index_checksum = 1;
verify_ce_order = 1;
- repo_read_index(the_repository);
- /* TODO: audit for interaction with sparse-index. */
- ensure_full_index(&the_index);
- for (i = 0; i < the_index.cache_nr; i++) {
- unsigned int mode;
- struct blob *blob;
- struct object *obj;
- mode = the_index.cache[i]->ce_mode;
- if (S_ISGITLINK(mode))
- continue;
- blob = lookup_blob(the_repository,
- &the_index.cache[i]->oid);
- if (!blob)
- continue;
- obj = &blob->object;
- obj->flags |= USED;
- fsck_put_object_name(&fsck_walk_options, &obj->oid,
- ":%s", the_index.cache[i]->name);
- mark_object_reachable(obj);
+ worktrees = get_worktrees();
+ for (p = worktrees; *p; p++) {
+ struct worktree *wt = *p;
+ struct index_state istate =
+ INDEX_STATE_INIT(the_repository);
+ char *path;
+
+ /*
+ * Make a copy since the buffer is reusable
+ * and may get overwritten by other calls
+ * while we're examining the index.
+ */
+ path = xstrdup(worktree_git_path(wt, "index"));
+ read_index_from(&istate, path, get_worktree_git_dir(wt));
+ fsck_index(&istate, path, wt->is_current);
+ discard_index(&istate);
+ free(path);
}
- if (the_index.cache_tree)
- fsck_cache_tree(the_index.cache_tree);
- fsck_resolve_undo(&the_index);
+ free_worktrees(worktrees);
}
check_connectivity();
diff --git a/builtin/fsmonitor--daemon.c b/builtin/fsmonitor--daemon.c
index 0feef8caf6..cae804a190 100644
--- a/builtin/fsmonitor--daemon.c
+++ b/builtin/fsmonitor--daemon.c
@@ -1,4 +1,5 @@
#include "builtin.h"
+#include "alloc.h"
#include "config.h"
#include "parse-options.h"
#include "fsmonitor.h"
diff --git a/builtin/gc.c b/builtin/gc.c
index 4486438624..c58fe8c936 100644
--- a/builtin/gc.c
+++ b/builtin/gc.c
@@ -11,6 +11,7 @@
*/
#include "builtin.h"
+#include "hex.h"
#include "repository.h"
#include "config.h"
#include "tempfile.h"
diff --git a/builtin/grep.c b/builtin/grep.c
index f7821c5fbb..c590fcb19d 100644
--- a/builtin/grep.c
+++ b/builtin/grep.c
@@ -4,6 +4,8 @@
* Copyright (c) 2006 Junio C Hamano
*/
#include "cache.h"
+#include "alloc.h"
+#include "hex.h"
#include "repository.h"
#include "config.h"
#include "blob.h"
diff --git a/builtin/hash-object.c b/builtin/hash-object.c
index 44db83f07f..1848768b97 100644
--- a/builtin/hash-object.c
+++ b/builtin/hash-object.c
@@ -6,6 +6,7 @@
*/
#include "builtin.h"
#include "config.h"
+#include "hex.h"
#include "object-store.h"
#include "blob.h"
#include "quote.h"
diff --git a/builtin/index-pack.c b/builtin/index-pack.c
index 6648f2daef..b451755f40 100644
--- a/builtin/index-pack.c
+++ b/builtin/index-pack.c
@@ -1,6 +1,8 @@
#include "builtin.h"
+#include "alloc.h"
#include "config.h"
#include "delta.h"
+#include "hex.h"
#include "pack.h"
#include "csum-file.h"
#include "blob.h"
@@ -14,6 +16,7 @@
#include "thread-utils.h"
#include "packfile.h"
#include "object-store.h"
+#include "replace-object.h"
#include "promisor-remote.h"
static const char index_pack_usage[] =
diff --git a/builtin/log.c b/builtin/log.c
index 813b768e24..0368e08926 100644
--- a/builtin/log.c
+++ b/builtin/log.c
@@ -4,8 +4,10 @@
* (C) Copyright 2006 Linus Torvalds
* 2006 Junio Hamano
*/
-#include "cache.h"
+#include "git-compat-util.h"
+#include "alloc.h"
#include "config.h"
+#include "hex.h"
#include "refs.h"
#include "object-store.h"
#include "color.h"
@@ -1007,6 +1009,8 @@ static int git_format_config(const char *var, const char *value, void *cb)
if (!strcmp(var, "format.attach")) {
if (value && *value)
default_attach = xstrdup(value);
+ else if (value && !*value)
+ FREE_AND_NULL(default_attach);
else
default_attach = xstrdup(git_version_string);
return 0;
diff --git a/builtin/ls-remote.c b/builtin/ls-remote.c
index 6516177348..2dfbd8ed9b 100644
--- a/builtin/ls-remote.c
+++ b/builtin/ls-remote.c
@@ -1,5 +1,6 @@
#include "builtin.h"
#include "cache.h"
+#include "hex.h"
#include "transport.h"
#include "ref-filter.h"
#include "remote.h"
diff --git a/builtin/ls-tree.c b/builtin/ls-tree.c
index 8cc8c995df..64d8e54318 100644
--- a/builtin/ls-tree.c
+++ b/builtin/ls-tree.c
@@ -5,6 +5,7 @@
*/
#include "cache.h"
#include "config.h"
+#include "hex.h"
#include "object-store.h"
#include "blob.h"
#include "tree.h"
diff --git a/builtin/merge-base.c b/builtin/merge-base.c
index 6f3941f2a4..be8f3b221c 100644
--- a/builtin/merge-base.c
+++ b/builtin/merge-base.c
@@ -2,6 +2,7 @@
#include "cache.h"
#include "config.h"
#include "commit.h"
+#include "hex.h"
#include "refs.h"
#include "diff.h"
#include "revision.h"
diff --git a/builtin/merge-index.c b/builtin/merge-index.c
index 452f833ac4..c875f5d37e 100644
--- a/builtin/merge-index.c
+++ b/builtin/merge-index.c
@@ -1,5 +1,6 @@
#define USE_THE_INDEX_VARIABLE
#include "builtin.h"
+#include "hex.h"
#include "run-command.h"
static const char *pgm;
diff --git a/builtin/merge-tree.c b/builtin/merge-tree.c
index 828dc81c42..e782518164 100644
--- a/builtin/merge-tree.c
+++ b/builtin/merge-tree.c
@@ -3,6 +3,7 @@
#include "tree-walk.h"
#include "xdiff-interface.h"
#include "help.h"
+#include "hex.h"
#include "commit.h"
#include "commit-reach.h"
#include "merge-ort.h"
diff --git a/builtin/merge.c b/builtin/merge.c
index 0a3c10a096..7347b738e5 100644
--- a/builtin/merge.c
+++ b/builtin/merge.c
@@ -8,7 +8,9 @@
#define USE_THE_INDEX_VARIABLE
#include "cache.h"
+#include "alloc.h"
#include "config.h"
+#include "hex.h"
#include "parse-options.h"
#include "builtin.h"
#include "lockfile.h"
diff --git a/builtin/mktag.c b/builtin/mktag.c
index 5d22909122..42c2457c70 100644
--- a/builtin/mktag.c
+++ b/builtin/mktag.c
@@ -1,4 +1,5 @@
#include "builtin.h"
+#include "hex.h"
#include "parse-options.h"
#include "tag.h"
#include "replace-object.h"
diff --git a/builtin/mktree.c b/builtin/mktree.c
index 06d81400f5..848c7b4747 100644
--- a/builtin/mktree.c
+++ b/builtin/mktree.c
@@ -4,6 +4,8 @@
* Copyright (c) Junio C Hamano, 2006, 2009
*/
#include "builtin.h"
+#include "alloc.h"
+#include "hex.h"
#include "quote.h"
#include "tree.h"
#include "parse-options.h"
diff --git a/builtin/mv.c b/builtin/mv.c
index edd7b931fd..8129050377 100644
--- a/builtin/mv.c
+++ b/builtin/mv.c
@@ -5,6 +5,7 @@
*/
#define USE_THE_INDEX_VARIABLE
#include "builtin.h"
+#include "alloc.h"
#include "config.h"
#include "pathspec.h"
#include "lockfile.h"
diff --git a/builtin/name-rev.c b/builtin/name-rev.c
index 97959bfaf9..723ba616a8 100644
--- a/builtin/name-rev.c
+++ b/builtin/name-rev.c
@@ -1,5 +1,6 @@
#include "builtin.h"
-#include "cache.h"
+#include "alloc.h"
+#include "hex.h"
#include "repository.h"
#include "config.h"
#include "commit.h"
diff --git a/builtin/notes.c b/builtin/notes.c
index d5713a9fac..75ce7f3f57 100644
--- a/builtin/notes.c
+++ b/builtin/notes.c
@@ -10,6 +10,7 @@
#include "cache.h"
#include "config.h"
#include "builtin.h"
+#include "hex.h"
#include "notes.h"
#include "object-store.h"
#include "repository.h"
diff --git a/builtin/pack-objects.c b/builtin/pack-objects.c
index d7eebeb6eb..545b8bddc8 100644
--- a/builtin/pack-objects.c
+++ b/builtin/pack-objects.c
@@ -1,5 +1,6 @@
#include "builtin.h"
-#include "cache.h"
+#include "alloc.h"
+#include "hex.h"
#include "repository.h"
#include "config.h"
#include "attr.h"
@@ -31,6 +32,7 @@
#include "list.h"
#include "packfile.h"
#include "object-store.h"
+#include "replace-object.h"
#include "dir.h"
#include "midx.h"
#include "trace2.h"
diff --git a/builtin/pack-redundant.c b/builtin/pack-redundant.c
index ecd49ca268..82115c5808 100644
--- a/builtin/pack-redundant.c
+++ b/builtin/pack-redundant.c
@@ -7,6 +7,7 @@
*/
#include "builtin.h"
+#include "hex.h"
#include "repository.h"
#include "packfile.h"
#include "object-store.h"
diff --git a/builtin/patch-id.c b/builtin/patch-id.c
index f840fbf1c7..338b15cd7b 100644
--- a/builtin/patch-id.c
+++ b/builtin/patch-id.c
@@ -2,6 +2,7 @@
#include "builtin.h"
#include "config.h"
#include "diff.h"
+#include "hex.h"
#include "parse-options.h"
static void flush_current_id(int patchlen, struct object_id *id, struct object_id *result)
diff --git a/builtin/prune.c b/builtin/prune.c
index 4580890393..119a253a2a 100644
--- a/builtin/prune.c
+++ b/builtin/prune.c
@@ -1,12 +1,14 @@
#include "cache.h"
#include "commit.h"
#include "diff.h"
+#include "hex.h"
#include "revision.h"
#include "builtin.h"
#include "reachable.h"
#include "parse-options.h"
#include "progress.h"
#include "prune-packed.h"
+#include "replace-object.h"
#include "object-store.h"
#include "shallow.h"
diff --git a/builtin/pull.c b/builtin/pull.c
index 1ab4de0005..963a47f0b8 100644
--- a/builtin/pull.c
+++ b/builtin/pull.c
@@ -9,6 +9,7 @@
#include "cache.h"
#include "config.h"
#include "builtin.h"
+#include "hex.h"
#include "parse-options.h"
#include "exec-cmd.h"
#include "run-command.h"
diff --git a/builtin/read-tree.c b/builtin/read-tree.c
index 3ce7541783..11759c415f 100644
--- a/builtin/read-tree.c
+++ b/builtin/read-tree.c
@@ -7,6 +7,7 @@
#define USE_THE_INDEX_VARIABLE
#include "cache.h"
#include "config.h"
+#include "hex.h"
#include "lockfile.h"
#include "object.h"
#include "tree.h"
@@ -87,9 +88,9 @@ static int debug_merge(const struct cache_entry * const *stages,
{
int i;
- printf("* %d-way merge\n", o->merge_size);
+ printf("* %d-way merge\n", o->internal.merge_size);
debug_stage("index", stages[0], o);
- for (i = 1; i <= o->merge_size; i++) {
+ for (i = 1; i <= o->internal.merge_size; i++) {
char buf[24];
xsnprintf(buf, sizeof(buf), "ent#%d", i);
debug_stage(buf, stages[i], o);
@@ -144,7 +145,7 @@ int cmd_read_tree(int argc, const char **argv, const char *cmd_prefix)
OPT__DRY_RUN(&opts.dry_run, N_("don't update the index or the work tree")),
OPT_BOOL(0, "no-sparse-checkout", &opts.skip_sparse_checkout,
N_("skip applying sparse checkout filter")),
- OPT_BOOL(0, "debug-unpack", &opts.debug_unpack,
+ OPT_BOOL(0, "debug-unpack", &opts.internal.debug_unpack,
N_("debug unpack-trees")),
OPT_CALLBACK_F(0, "recurse-submodules", NULL,
"checkout", "control recursive updating of submodules",
@@ -247,7 +248,7 @@ int cmd_read_tree(int argc, const char **argv, const char *cmd_prefix)
opts.head_idx = 1;
}
- if (opts.debug_unpack)
+ if (opts.internal.debug_unpack)
opts.fn = debug_merge;
/* If we're going to prime_cache_tree later, skip cache tree update */
@@ -263,7 +264,7 @@ int cmd_read_tree(int argc, const char **argv, const char *cmd_prefix)
if (unpack_trees(nr_trees, t, &opts))
return 128;
- if (opts.debug_unpack || opts.dry_run)
+ if (opts.internal.debug_unpack || opts.dry_run)
return 0; /* do not write the index out */
/*
diff --git a/builtin/rebase.c b/builtin/rebase.c
index 6635f10d52..ef8ce2f72c 100644
--- a/builtin/rebase.c
+++ b/builtin/rebase.c
@@ -6,6 +6,7 @@
#define USE_THE_INDEX_VARIABLE
#include "builtin.h"
+#include "hex.h"
#include "run-command.h"
#include "exec-cmd.h"
#include "strvec.h"
diff --git a/builtin/receive-pack.c b/builtin/receive-pack.c
index cd5c7a28ef..3d2b4c8b4f 100644
--- a/builtin/receive-pack.c
+++ b/builtin/receive-pack.c
@@ -1,6 +1,7 @@
#include "builtin.h"
#include "repository.h"
#include "config.h"
+#include "hex.h"
#include "lockfile.h"
#include "pack.h"
#include "refs.h"
diff --git a/builtin/repack.c b/builtin/repack.c
index 36b511c564..87f73c8923 100644
--- a/builtin/repack.c
+++ b/builtin/repack.c
@@ -1,7 +1,8 @@
#include "builtin.h"
-#include "cache.h"
+#include "alloc.h"
#include "config.h"
#include "dir.h"
+#include "hex.h"
#include "parse-options.h"
#include "run-command.h"
#include "sigchain.h"
diff --git a/builtin/replace.c b/builtin/replace.c
index a29e911d30..71d8e949e3 100644
--- a/builtin/replace.c
+++ b/builtin/replace.c
@@ -11,10 +11,12 @@
#include "cache.h"
#include "config.h"
#include "builtin.h"
+#include "hex.h"
#include "refs.h"
#include "parse-options.h"
#include "run-command.h"
#include "object-store.h"
+#include "replace-object.h"
#include "repository.h"
#include "tag.h"
diff --git a/builtin/reset.c b/builtin/reset.c
index 0697fa89de..58f567afd3 100644
--- a/builtin/reset.c
+++ b/builtin/reset.c
@@ -10,6 +10,7 @@
#define USE_THE_INDEX_VARIABLE
#include "builtin.h"
#include "config.h"
+#include "hex.h"
#include "lockfile.h"
#include "tag.h"
#include "object.h"
diff --git a/builtin/rev-list.c b/builtin/rev-list.c
index 888ad6b5c0..1a33d514d1 100644
--- a/builtin/rev-list.c
+++ b/builtin/rev-list.c
@@ -2,6 +2,7 @@
#include "config.h"
#include "commit.h"
#include "diff.h"
+#include "hex.h"
#include "revision.h"
#include "list-objects.h"
#include "list-objects-filter.h"
diff --git a/builtin/rev-parse.c b/builtin/rev-parse.c
index e67999e5eb..e1fa9c6348 100644
--- a/builtin/rev-parse.c
+++ b/builtin/rev-parse.c
@@ -5,8 +5,10 @@
*/
#define USE_THE_INDEX_VARIABLE
#include "cache.h"
+#include "alloc.h"
#include "config.h"
#include "commit.h"
+#include "hex.h"
#include "refs.h"
#include "quote.h"
#include "builtin.h"
diff --git a/builtin/revert.c b/builtin/revert.c
index 77d2035616..62986a7b1b 100644
--- a/builtin/revert.c
+++ b/builtin/revert.c
@@ -1,4 +1,5 @@
-#include "cache.h"
+#include "git-compat-util.h"
+#include "alloc.h"
#include "config.h"
#include "builtin.h"
#include "parse-options.h"
diff --git a/builtin/rm.c b/builtin/rm.c
index 8844f90655..dc198f7908 100644
--- a/builtin/rm.c
+++ b/builtin/rm.c
@@ -5,6 +5,7 @@
*/
#define USE_THE_INDEX_VARIABLE
#include "builtin.h"
+#include "alloc.h"
#include "advice.h"
#include "config.h"
#include "lockfile.h"
diff --git a/builtin/send-pack.c b/builtin/send-pack.c
index 4c5d125fa0..127ced435d 100644
--- a/builtin/send-pack.c
+++ b/builtin/send-pack.c
@@ -1,6 +1,7 @@
#include "builtin.h"
#include "config.h"
#include "commit.h"
+#include "hex.h"
#include "refs.h"
#include "pkt-line.h"
#include "sideband.h"
diff --git a/builtin/show-branch.c b/builtin/show-branch.c
index 358ac3e519..8342b68aef 100644
--- a/builtin/show-branch.c
+++ b/builtin/show-branch.c
@@ -1,5 +1,6 @@
#include "cache.h"
#include "config.h"
+#include "hex.h"
#include "pretty.h"
#include "refs.h"
#include "builtin.h"
diff --git a/builtin/show-index.c b/builtin/show-index.c
index 0e0b9fb95b..98ec40ddf4 100644
--- a/builtin/show-index.c
+++ b/builtin/show-index.c
@@ -1,5 +1,6 @@
#include "builtin.h"
#include "cache.h"
+#include "hex.h"
#include "pack.h"
#include "parse-options.h"
diff --git a/builtin/show-ref.c b/builtin/show-ref.c
index 3af6a53ee9..1f28d7fe4b 100644
--- a/builtin/show-ref.c
+++ b/builtin/show-ref.c
@@ -1,6 +1,7 @@
#include "builtin.h"
#include "cache.h"
#include "config.h"
+#include "hex.h"
#include "refs.h"
#include "object-store.h"
#include "object.h"
diff --git a/builtin/sparse-checkout.c b/builtin/sparse-checkout.c
index c373815491..8d5ae6f2a6 100644
--- a/builtin/sparse-checkout.c
+++ b/builtin/sparse-checkout.c
@@ -217,16 +217,14 @@ static int update_working_directory(struct pattern_list *pl)
o.head_idx = -1;
o.src_index = r->index;
o.dst_index = r->index;
- index_state_init(&o.result, r);
o.skip_sparse_checkout = 0;
- o.pl = pl;
setup_work_tree();
repo_hold_locked_index(r, &lock_file, LOCK_DIE_ON_ERROR);
setup_unpack_trees_porcelain(&o, "sparse-checkout");
- result = update_sparsity(&o);
+ result = update_sparsity(&o, pl);
clear_unpack_trees_porcelain(&o);
if (result == UPDATE_SPARSITY_WARNINGS)
diff --git a/builtin/stash.c b/builtin/stash.c
index 3a4f9fd566..6a12fed271 100644
--- a/builtin/stash.c
+++ b/builtin/stash.c
@@ -1,6 +1,7 @@
#define USE_THE_INDEX_VARIABLE
#include "builtin.h"
#include "config.h"
+#include "hex.h"
#include "parse-options.h"
#include "refs.h"
#include "lockfile.h"
diff --git a/builtin/submodule--helper.c b/builtin/submodule--helper.c
index ad272a0d93..d05d1a8462 100644
--- a/builtin/submodule--helper.c
+++ b/builtin/submodule--helper.c
@@ -1,5 +1,7 @@
#define USE_THE_INDEX_VARIABLE
#include "builtin.h"
+#include "alloc.h"
+#include "hex.h"
#include "repository.h"
#include "cache.h"
#include "config.h"
diff --git a/builtin/tag.c b/builtin/tag.c
index d428c45dc8..be094882d0 100644
--- a/builtin/tag.c
+++ b/builtin/tag.c
@@ -9,6 +9,7 @@
#include "cache.h"
#include "config.h"
#include "builtin.h"
+#include "hex.h"
#include "refs.h"
#include "object-store.h"
#include "tag.h"
diff --git a/builtin/unpack-file.c b/builtin/unpack-file.c
index 88de32b7d7..e9b105a539 100644
--- a/builtin/unpack-file.c
+++ b/builtin/unpack-file.c
@@ -1,5 +1,6 @@
#include "builtin.h"
#include "config.h"
+#include "hex.h"
#include "object-store.h"
static char *create_temp_file(struct object_id *oid)
diff --git a/builtin/unpack-objects.c b/builtin/unpack-objects.c
index 43789b8ef2..1908dcfcff 100644
--- a/builtin/unpack-objects.c
+++ b/builtin/unpack-objects.c
@@ -2,12 +2,14 @@
#include "cache.h"
#include "bulk-checkin.h"
#include "config.h"
+#include "hex.h"
#include "object-store.h"
#include "object.h"
#include "delta.h"
#include "pack.h"
#include "blob.h"
#include "commit.h"
+#include "replace-object.h"
#include "tag.h"
#include "tree.h"
#include "tree-walk.h"
diff --git a/builtin/update-index.c b/builtin/update-index.c
index bf38885d54..11dc135271 100644
--- a/builtin/update-index.c
+++ b/builtin/update-index.c
@@ -7,6 +7,7 @@
#include "cache.h"
#include "bulk-checkin.h"
#include "config.h"
+#include "hex.h"
#include "lockfile.h"
#include "quote.h"
#include "cache-tree.h"
diff --git a/builtin/upload-pack.c b/builtin/upload-pack.c
index 25b69da2bf..7a3c68720f 100644
--- a/builtin/upload-pack.c
+++ b/builtin/upload-pack.c
@@ -4,6 +4,7 @@
#include "pkt-line.h"
#include "parse-options.h"
#include "protocol.h"
+#include "replace-object.h"
#include "upload-pack.h"
#include "serve.h"
diff --git a/builtin/var.c b/builtin/var.c
index a80c1df86f..d9943be9af 100644
--- a/builtin/var.c
+++ b/builtin/var.c
@@ -5,6 +5,7 @@
*/
#include "builtin.h"
#include "config.h"
+#include "ident.h"
#include "refs.h"
static const char var_usage[] = "git var (-l | <variable>)";
diff --git a/builtin/worktree.c b/builtin/worktree.c
index 254283aa6f..80d05e246d 100644
--- a/builtin/worktree.c
+++ b/builtin/worktree.c
@@ -3,6 +3,7 @@
#include "config.h"
#include "builtin.h"
#include "dir.h"
+#include "hex.h"
#include "parse-options.h"
#include "strvec.h"
#include "branch.h"
diff --git a/builtin/write-tree.c b/builtin/write-tree.c
index 078010315f..7ad0d05945 100644
--- a/builtin/write-tree.c
+++ b/builtin/write-tree.c
@@ -7,6 +7,7 @@
#include "builtin.h"
#include "cache.h"
#include "config.h"
+#include "hex.h"
#include "tree.h"
#include "cache-tree.h"
#include "parse-options.h"