path: root/cache-tree.c
diff options
authorLinus Torvalds <>2007-04-10 04:20:29 (GMT)
committerJunio C Hamano <>2007-04-10 20:50:43 (GMT)
commitf35a6d3bce79c2995bbf0a3bd9fcad29e54a8d3c (patch)
treefca31eb00aea9a6a82ff493090c2da81af761ccc /cache-tree.c
parent8d9721c86b0169c282ad1c5528317eafeb7fb0f7 (diff)
Teach core object handling functions about gitlinks
This teaches the really fundamental core SHA1 object handling routines about gitlinks. We can compare trees with gitlinks in them (although we can not actually generate patches for them yet - just raw git diffs), and they show up as commits in "git ls-tree". We also know to compare gitlinks as if they were directories (ie the normal "sort as trees" rules apply). [jc: amended a cut&paste error] Signed-off-by: Linus Torvalds <> Signed-off-by: Junio C Hamano <>
Diffstat (limited to 'cache-tree.c')
1 files changed, 1 insertions, 1 deletions
diff --git a/cache-tree.c b/cache-tree.c
index 9b73c86..6369cc7 100644
--- a/cache-tree.c
+++ b/cache-tree.c
@@ -326,7 +326,7 @@ static int update_one(struct cache_tree *it,
mode = ntohl(ce->ce_mode);
entlen = pathlen - baselen;
- if (!missing_ok && !has_sha1_file(sha1))
+ if (mode != S_IFDIRLNK && !missing_ok && !has_sha1_file(sha1))
return error("invalid object %s", sha1_to_hex(sha1));
if (!ce->ce_mode)