@@ -21,6 +21,14 @@ static void process_blob(struct blob *blob,
21
21
/* Nothing to do, really .. The blob lookup was the important part */
22
22
}
23
23
24
+ static void process_gitlink (const unsigned char * sha1 ,
25
+ struct object_array * p ,
26
+ struct name_path * path ,
27
+ const char * name )
28
+ {
29
+ /* I don't think we want to recurse into this, really. */
30
+ }
31
+
24
32
static void process_tree (struct tree * tree ,
25
33
struct object_array * p ,
26
34
struct name_path * path ,
@@ -47,6 +55,8 @@ static void process_tree(struct tree *tree,
47
55
while (tree_entry (& desc , & entry )) {
48
56
if (S_ISDIR (entry .mode ))
49
57
process_tree (lookup_tree (entry .sha1 ), p , & me , entry .path );
58
+ else if (S_ISGITLINK (entry .mode ))
59
+ process_gitlink (entry .sha1 , p , & me , entry .path );
50
60
else
51
61
process_blob (lookup_blob (entry .sha1 ), p , & me , entry .path );
52
62
}
@@ -159,6 +169,16 @@ static void add_cache_refs(struct rev_info *revs)
159
169
160
170
read_cache ();
161
171
for (i = 0 ; i < active_nr ; i ++ ) {
172
+ /*
173
+ * The index can contain blobs and GITLINKs, GITLINKs are hashes
174
+ * that don't actually point to objects in the repository, it's
175
+ * almost guaranteed that they are NOT blobs, so we don't call
176
+ * lookup_blob() on them, to avoid populating the hash table
177
+ * with invalid information
178
+ */
179
+ if (S_ISGITLINK (ntohl (active_cache [i ]-> ce_mode )))
180
+ continue ;
181
+
162
182
lookup_blob (active_cache [i ]-> sha1 );
163
183
/*
164
184
* We could add the blobs to the pending list, but quite
0 commit comments