From 629162ad350b7e478173dcacfd88683aa687f3dd Mon Sep 17 00:00:00 2001
From: James Moger <james.moger@gitblit.com>
Date: Thu, 09 Aug 2012 09:57:21 -0400
Subject: [PATCH] Documentation
---
src/com/gitblit/utils/JGitUtils.java | 24 +++++++++++++-----------
1 files changed, 13 insertions(+), 11 deletions(-)
diff --git a/src/com/gitblit/utils/JGitUtils.java b/src/com/gitblit/utils/JGitUtils.java
index 4415982..90e6a76 100644
--- a/src/com/gitblit/utils/JGitUtils.java
+++ b/src/com/gitblit/utils/JGitUtils.java
@@ -559,18 +559,20 @@
}
ObjectId entid = tw.getObjectId(0);
FileMode entmode = tw.getFileMode(0);
- RevObject ro = rw.lookupAny(entid, entmode.getObjectType());
- rw.parseBody(ro);
- ByteArrayOutputStream os = new ByteArrayOutputStream();
- ObjectLoader ldr = repository.open(ro.getId(), Constants.OBJ_BLOB);
- byte[] tmp = new byte[4096];
- InputStream in = ldr.openStream();
- int n;
- while ((n = in.read(tmp)) > 0) {
- os.write(tmp, 0, n);
+ if (entmode != FileMode.GITLINK) {
+ RevObject ro = rw.lookupAny(entid, entmode.getObjectType());
+ rw.parseBody(ro);
+ ByteArrayOutputStream os = new ByteArrayOutputStream();
+ ObjectLoader ldr = repository.open(ro.getId(), Constants.OBJ_BLOB);
+ byte[] tmp = new byte[4096];
+ InputStream in = ldr.openStream();
+ int n;
+ while ((n = in.read(tmp)) > 0) {
+ os.write(tmp, 0, n);
+ }
+ in.close();
+ content = os.toByteArray();
}
- in.close();
- content = os.toByteArray();
}
} catch (Throwable t) {
error(t, repository, "{0} can't find {1} in tree {2}", path, tree.name());
--
Gitblit v1.9.1