summaryrefslogtreecommitdiffstats
path: root/fsck.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2024-05-24 21:29:35 +0200
committerJunio C Hamano <gitster@pobox.com>2024-05-24 21:29:36 +0200
commit48440f60a730b93b2a39449a69cb56db5e7114c7 (patch)
tree6547cae6f0c29cd3a8be08c3abb2e004b8fae3de /fsck.c
parentGit 2.40.2 (diff)
parentRevert "fsck: warn about symlink pointing inside a gitdir" (diff)
downloadgit-48440f60a730b93b2a39449a69cb56db5e7114c7.tar.xz
git-48440f60a730b93b2a39449a69cb56db5e7114c7.zip
Merge branch 'jc/fix-2.45.1-and-friends-for-2.39' into fixes/2.45.1/2.40
Revert overly aggressive "layered defence" that went into 2.45.1 and friends, which broke "git-lfs", "git-annex", and other use cases, so that we can rebuild necessary counterparts in the open. * jc/fix-2.45.1-and-friends-for-2.39: Revert "fsck: warn about symlink pointing inside a gitdir" Revert "Add a helper function to compare file contents" clone: drop the protections where hooks aren't run tests: verify that `clone -c core.hooksPath=/dev/null` works again Revert "core.hooksPath: add some protection while cloning" init: use the correct path of the templates directory again hook: plug a new memory leak ci: stop installing "gcc-13" for osx-gcc ci: avoid bare "gcc" for osx-gcc job ci: drop mention of BREW_INSTALL_PACKAGES variable send-email: avoid creating more than one Term::ReadLine object send-email: drop FakeTerm hack
Diffstat (limited to 'fsck.c')
-rw-r--r--fsck.c56
1 files changed, 0 insertions, 56 deletions
diff --git a/fsck.c b/fsck.c
index 3ba690bda8..2b18717ee8 100644
--- a/fsck.c
+++ b/fsck.c
@@ -636,8 +636,6 @@ static int fsck_tree(const struct object_id *tree_oid,
retval += report(options, tree_oid, OBJ_TREE,
FSCK_MSG_MAILMAP_SYMLINK,
".mailmap is a symlink");
- oidset_insert(&options->symlink_targets_found,
- entry_oid);
}
if ((backslash = strchr(name, '\\'))) {
@@ -1271,56 +1269,6 @@ static int fsck_blob(const struct object_id *oid, const char *buf,
}
}
- if (oidset_contains(&options->symlink_targets_found, oid)) {
- const char *ptr = buf;
- const struct object_id *reported = NULL;
-
- oidset_insert(&options->symlink_targets_done, oid);
-
- if (!buf || size > PATH_MAX) {
- /*
- * A missing buffer here is a sign that the caller found the
- * blob too gigantic to load into memory. Let's just consider
- * that an error.
- */
- return report(options, oid, OBJ_BLOB,
- FSCK_MSG_SYMLINK_TARGET_LENGTH,
- "symlink target too long");
- }
-
- while (!reported && ptr) {
- const char *p = ptr;
- char c, *slash = strchrnul(ptr, '/');
- char *backslash = memchr(ptr, '\\', slash - ptr);
-
- c = *slash;
- *slash = '\0';
-
- while (!reported && backslash) {
- *backslash = '\0';
- if (is_ntfs_dotgit(p))
- ret |= report(options, reported = oid, OBJ_BLOB,
- FSCK_MSG_SYMLINK_POINTS_TO_GIT_DIR,
- "symlink target points to git dir");
- *backslash = '\\';
- p = backslash + 1;
- backslash = memchr(p, '\\', slash - p);
- }
- if (!reported && is_ntfs_dotgit(p))
- ret |= report(options, reported = oid, OBJ_BLOB,
- FSCK_MSG_SYMLINK_POINTS_TO_GIT_DIR,
- "symlink target points to git dir");
-
- if (!reported && is_hfs_dotgit(ptr))
- ret |= report(options, reported = oid, OBJ_BLOB,
- FSCK_MSG_SYMLINK_POINTS_TO_GIT_DIR,
- "symlink target points to git dir");
-
- *slash = c;
- ptr = c ? slash + 1 : NULL;
- }
- }
-
return ret;
}
@@ -1419,10 +1367,6 @@ int fsck_finish(struct fsck_options *options)
FSCK_MSG_GITATTRIBUTES_MISSING, FSCK_MSG_GITATTRIBUTES_BLOB,
options, ".gitattributes");
- ret |= fsck_blobs(&options->symlink_targets_found, &options->symlink_targets_done,
- FSCK_MSG_SYMLINK_TARGET_MISSING, FSCK_MSG_SYMLINK_TARGET_BLOB,
- options, "<symlink-target>");
-
return ret;
}