\r
#### fixes\r
\r
+- Do not index blobs in submodules (issue 119)\r
- Restore original user or team object on failure to update (issue 118)\r
- Repository URL uses `X-Forwarded-Proto` and `X-Forwarded-Port`, if available, for reverse proxy configurations (issue 115)\r
- Fixes to relative path determination in repository searh algorithm for symlinks (issue 116)\r
\r
Map<String, ObjectId> paths = new TreeMap<String, ObjectId>();\r
while (treeWalk.next()) {\r
+ // ensure path is not in a submodule\r
if (treeWalk.getFileMode(0) != FileMode.GITLINK) {\r
paths.put(treeWalk.getPathString(), treeWalk.getObjectId(0));\r
}\r
// read the blob content\r
String str = JGitUtils.getStringContent(repository, commit.getTree(),\r
path.path, encodings);\r
- doc.add(new Field(FIELD_CONTENT, str, Store.YES, Index.ANALYZED));\r
- writer.addDocument(doc);\r
+ if (str != null) {\r
+ doc.add(new Field(FIELD_CONTENT, str, Store.YES, Index.ANALYZED));\r
+ writer.addDocument(doc);\r
+ }\r
}\r
}\r
}\r
}\r
ObjectId entid = tw.getObjectId(0);\r
FileMode entmode = tw.getFileMode(0);\r
- RevObject ro = rw.lookupAny(entid, entmode.getObjectType());\r
- rw.parseBody(ro);\r
- ByteArrayOutputStream os = new ByteArrayOutputStream();\r
- ObjectLoader ldr = repository.open(ro.getId(), Constants.OBJ_BLOB);\r
- byte[] tmp = new byte[4096];\r
- InputStream in = ldr.openStream();\r
- int n;\r
- while ((n = in.read(tmp)) > 0) {\r
- os.write(tmp, 0, n);\r
+ if (entmode != FileMode.GITLINK) {\r
+ RevObject ro = rw.lookupAny(entid, entmode.getObjectType());\r
+ rw.parseBody(ro);\r
+ ByteArrayOutputStream os = new ByteArrayOutputStream();\r
+ ObjectLoader ldr = repository.open(ro.getId(), Constants.OBJ_BLOB);\r
+ byte[] tmp = new byte[4096];\r
+ InputStream in = ldr.openStream();\r
+ int n;\r
+ while ((n = in.read(tmp)) > 0) {\r
+ os.write(tmp, 0, n);\r
+ }\r
+ in.close();\r
+ content = os.toByteArray();\r
}\r
- in.close();\r
- content = os.toByteArray();\r
}\r
} catch (Throwable t) {\r
error(t, repository, "{0} can't find {1} in tree {2}", path, tree.name());\r