aboutsummaryrefslogtreecommitdiffstats
path: root/read-cache.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2025-11-24 15:46:39 -0800
committerJunio C Hamano <gitster@pobox.com>2025-11-24 15:46:40 -0800
commitd91d79f26d5f2fb0468f42bf5d44356dce15a414 (patch)
treede53faa3734dbc893bceabc212dfdbd70ffa5acf /read-cache.c
parent54f7817456940bb1f72cb747328e5fde75307dc3 (diff)
parent6fe288bfbcbbabc3d399dd71f876dccf71affff0 (diff)
downloadgit-d91d79f26d5f2fb0468f42bf5d44356dce15a414.tar.gz
Merge branch 'bc/submodule-force-same-hash'
Adding a repository that uses a different hash function is a no-no, but "git submodule add" did nt prevent it, which has been corrected. * bc/submodule-force-same-hash: read-cache: drop submodule check from add_to_cache() object-file: disallow adding submodules of different hash algo
Diffstat (limited to 'read-cache.c')
-rw-r--r--read-cache.c3
1 files changed, 0 insertions, 3 deletions
diff --git a/read-cache.c b/read-cache.c
index 032480d0c7..990d4ead0d 100644
--- a/read-cache.c
+++ b/read-cache.c
@@ -706,7 +706,6 @@ int add_to_index(struct index_state *istate, const char *path, struct stat *st,
int add_option = (ADD_CACHE_OK_TO_ADD|ADD_CACHE_OK_TO_REPLACE|
(intent_only ? ADD_CACHE_NEW_ONLY : 0));
unsigned hash_flags = pretend ? 0 : INDEX_WRITE_OBJECT;
- struct object_id oid;
if (flags & ADD_CACHE_RENORMALIZE)
hash_flags |= INDEX_RENORMALIZE;
@@ -716,8 +715,6 @@ int add_to_index(struct index_state *istate, const char *path, struct stat *st,
namelen = strlen(path);
if (S_ISDIR(st_mode)) {
- if (repo_resolve_gitlink_ref(the_repository, path, "HEAD", &oid) < 0)
- return error(_("'%s' does not have a commit checked out"), path);
while (namelen && path[namelen-1] == '/')
namelen--;
}