summaryrefslogtreecommitdiff
path: root/builtin
diff options
context:
space:
mode:
authorLibravatar Jiang Xin <worldhello.net@gmail.com>2021-03-04 22:40:13 +0800
committerLibravatar Jiang Xin <worldhello.net@gmail.com>2021-03-04 22:40:13 +0800
commit4dd8469336cc06923acceb3ea4ae02ea00461c5d (patch)
tree92aa9b355242c8904510bb9b61ddfa94b4d1ee47 /builtin
parentl10n: tr: v2.31.0-rc0 (diff)
parentGit 2.31-rc1 (diff)
downloadtgif-4dd8469336cc06923acceb3ea4ae02ea00461c5d.tar.xz
Merge branch 'master' of github.com:git/git
* 'master' of github.com:git/git: (63 commits) Git 2.31-rc1 Hopefully the last batch before -rc1 Revert "commit-graph: when incompatible with graphs, indicate why" read-cache: make the index write buffer size 128K dir: fix malloc of root untracked_cache_dir commit-graph.c: display correct number of chunks when writing doc/reftable: document how to handle windows fetch-pack: print and use dangling .gitmodules fetch-pack: with packfile URIs, use index-pack arg http-fetch: allow custom index-pack args http: allow custom index-pack args chunk-format: add technical docs chunk-format: restore duplicate chunk checks midx: use 64-bit multiplication for chunk sizes midx: use chunk-format read API commit-graph: use chunk-format read API chunk-format: create read chunk API midx: use chunk-format API in write_midx_internal() midx: drop chunk progress during write midx: return success/failure in chunk write methods ...
Diffstat (limited to 'builtin')
-rw-r--r--builtin/index-pack.c25
-rw-r--r--builtin/receive-pack.c2
2 files changed, 24 insertions, 3 deletions
diff --git a/builtin/index-pack.c b/builtin/index-pack.c
index 54f74c4874..bad5748807 100644
--- a/builtin/index-pack.c
+++ b/builtin/index-pack.c
@@ -1712,6 +1712,22 @@ static void show_pack_info(int stat_only)
}
}
+static int print_dangling_gitmodules(struct fsck_options *o,
+ const struct object_id *oid,
+ enum object_type object_type,
+ int msg_type, const char *message)
+{
+ /*
+ * NEEDSWORK: Plumb the MSG_ID (from fsck.c) here and use it
+ * instead of relying on this string check.
+ */
+ if (starts_with(message, "gitmodulesMissing")) {
+ printf("%s\n", oid_to_hex(oid));
+ return 0;
+ }
+ return fsck_error_function(o, oid, object_type, msg_type, message);
+}
+
int cmd_index_pack(int argc, const char **argv, const char *prefix)
{
int i, fix_thin_pack = 0, verify = 0, stat_only = 0, rev_index;
@@ -1932,8 +1948,13 @@ int cmd_index_pack(int argc, const char **argv, const char *prefix)
else
close(input_fd);
- if (do_fsck_object && fsck_finish(&fsck_options))
- die(_("fsck error in pack objects"));
+ if (do_fsck_object) {
+ struct fsck_options fo = fsck_options;
+
+ fo.error_func = print_dangling_gitmodules;
+ if (fsck_finish(&fo))
+ die(_("fsck error in pack objects"));
+ }
free(objects);
strbuf_release(&index_name_buf);
diff --git a/builtin/receive-pack.c b/builtin/receive-pack.c
index b89ce31bf2..d26040c477 100644
--- a/builtin/receive-pack.c
+++ b/builtin/receive-pack.c
@@ -2275,7 +2275,7 @@ static const char *unpack(int err_fd, struct shallow_info *si)
status = start_command(&child);
if (status)
return "index-pack fork failed";
- pack_lockfile = index_pack_lockfile(child.out);
+ pack_lockfile = index_pack_lockfile(child.out, NULL);
close(child.out);
status = finish_command(&child);
if (status)