Sync with Git 2.17.1
* maint: (25 commits) Git 2.17.1 Git 2.16.4 Git 2.15.2 Git 2.14.4 Git 2.13.7 fsck: complain when .gitmodules is a symlink index-pack: check .gitmodules files with --strict unpack-objects: call fsck_finish() after fscking objects fsck: call fsck_finish() after fscking objects fsck: check .gitmodules content fsck: handle promisor objects in .gitmodules check fsck: detect gitmodules files fsck: actually fsck blob data fsck: simplify ".git" check index-pack: make fsck error message more specific verify_path: disallow symlinks in .gitmodules update-index: stat updated files earlier verify_dotfile: mention case-insensitivity in comment verify_path: drop clever fallthrough skip_prefix: add case-insensitive variant ...
This commit is contained in:
@ -837,6 +837,9 @@ static void sha1_object(const void *data, struct object_entry *obj_entry,
|
||||
blob->object.flags |= FLAG_CHECKED;
|
||||
else
|
||||
die(_("invalid blob object %s"), oid_to_hex(oid));
|
||||
if (do_fsck_object &&
|
||||
fsck_object(&blob->object, (void *)data, size, &fsck_options))
|
||||
die(_("fsck error in packed object"));
|
||||
} else {
|
||||
struct object *obj;
|
||||
int eaten;
|
||||
@ -854,7 +857,7 @@ static void sha1_object(const void *data, struct object_entry *obj_entry,
|
||||
die(_("invalid %s"), type_name(type));
|
||||
if (do_fsck_object &&
|
||||
fsck_object(obj, buf, size, &fsck_options))
|
||||
die(_("Error in object"));
|
||||
die(_("fsck error in packed object"));
|
||||
if (strict && fsck_walk(obj, NULL, &fsck_options))
|
||||
die(_("Not all child objects of %s are reachable"), oid_to_hex(&obj->oid));
|
||||
|
||||
@ -1479,6 +1482,9 @@ static void final(const char *final_pack_name, const char *curr_pack_name,
|
||||
} else
|
||||
chmod(final_index_name, 0444);
|
||||
|
||||
if (do_fsck_object)
|
||||
add_packed_git(final_index_name, strlen(final_index_name), 0);
|
||||
|
||||
if (!from_stdin) {
|
||||
printf("%s\n", sha1_to_hex(hash));
|
||||
} else {
|
||||
@ -1820,6 +1826,10 @@ int cmd_index_pack(int argc, const char **argv, const char *prefix)
|
||||
pack_hash);
|
||||
else
|
||||
close(input_fd);
|
||||
|
||||
if (do_fsck_object && fsck_finish(&fsck_options))
|
||||
die(_("fsck error in pack objects"));
|
||||
|
||||
free(objects);
|
||||
strbuf_release(&index_name_buf);
|
||||
if (pack_name == NULL)
|
||||
|
||||
Reference in New Issue
Block a user