diff options
author | James Moger <james.moger@gitblit.com> | 2011-06-25 08:57:29 -0400 |
---|---|---|
committer | James Moger <james.moger@gitblit.com> | 2011-06-25 08:57:29 -0400 |
commit | 85c2e6eb34215e2242e388a8f8b7173a14b96ad3 (patch) | |
tree | b3d3d0b5f4b9c57d99be39ebda3e944aa22e98d4 /src/com/gitblit/utils | |
parent | 0fe70c1cf434f492286e01e8528322134a10281a (diff) | |
download | gitblit-85c2e6eb34215e2242e388a8f8b7173a14b96ad3.tar.gz gitblit-85c2e6eb34215e2242e388a8f8b7173a14b96ad3.zip |
Big push for first release.
* Build script overhaul including building & publishing GO, WAR, Docs,
and Site.
* Restored JGit 0.12.1 dependency and backported Blame. Got tired of
waiting for JGit 1.0.0 Maven artifacts.
* Changed Summary Page layout
* Optional cookie authentication
* Added icons for log, tags, and branches panels.
* Show last commit author and short message on branches panel.
* Unit testing.
* Documentation.
Diffstat (limited to 'src/com/gitblit/utils')
-rw-r--r-- | src/com/gitblit/utils/JGitUtils.java | 15 | ||||
-rw-r--r-- | src/com/gitblit/utils/StringUtils.java | 7 |
2 files changed, 18 insertions, 4 deletions
diff --git a/src/com/gitblit/utils/JGitUtils.java b/src/com/gitblit/utils/JGitUtils.java index 5656efb3..1c607ca7 100644 --- a/src/com/gitblit/utils/JGitUtils.java +++ b/src/com/gitblit/utils/JGitUtils.java @@ -402,12 +402,12 @@ public class JGitUtils { public static List<PathChangeModel> getFilesInCommit(Repository r, RevCommit commit) {
List<PathChangeModel> list = new ArrayList<PathChangeModel>();
- RevWalk rw = new RevWalk(r);
+ RevWalk rw = new RevWalk(r);
try {
if (commit == null) {
ObjectId object = r.resolve(Constants.HEAD);
commit = rw.parseCommit(object);
- }
+ }
if (commit.getParentCount() == 0) {
TreeWalk tw = new TreeWalk(r);
@@ -441,7 +441,7 @@ public class JGitUtils { } catch (Throwable t) {
LOGGER.error("failed to determine files in commit!", t);
} finally {
- rw.dispose();
+ rw.dispose();
}
return list;
}
@@ -526,6 +526,9 @@ public class JGitUtils { public static List<RevCommit> getRevLog(Repository r, String objectId, String path, int offset,
int maxCount) {
List<RevCommit> list = new ArrayList<RevCommit>();
+ if (maxCount == 0) {
+ return list;
+ }
if (!hasCommits(r)) {
return list;
}
@@ -591,6 +594,9 @@ public class JGitUtils { final SearchType type, int offset, int maxCount) {
final String lcValue = value.toLowerCase();
List<RevCommit> list = new ArrayList<RevCommit>();
+ if (maxCount == 0) {
+ return list;
+ }
if (!hasCommits(r)) {
return list;
}
@@ -677,6 +683,9 @@ public class JGitUtils { private static List<RefModel> getRefs(Repository r, String refs, boolean fullName, int maxCount) {
List<RefModel> list = new ArrayList<RefModel>();
+ if (maxCount == 0) {
+ return list;
+ }
try {
Map<String, Ref> map = r.getRefDatabase().getRefs(refs);
RevWalk rw = new RevWalk(r);
diff --git a/src/com/gitblit/utils/StringUtils.java b/src/com/gitblit/utils/StringUtils.java index b53b5e15..219699fc 100644 --- a/src/com/gitblit/utils/StringUtils.java +++ b/src/com/gitblit/utils/StringUtils.java @@ -58,6 +58,11 @@ public class StringUtils { return retStr.toString();
}
+ public static String decodeFromHtml(String inStr) {
+ return inStr.replace("&", "&").replace("<", "<").replace(">", ">")
+ .replace(""", "\"").replace(" ", " ");
+ }
+
public static String encodeURL(String inStr) {
StringBuffer retStr = new StringBuffer();
int i = 0;
@@ -165,7 +170,7 @@ public class StringUtils { }
return sb.toString();
}
-
+
public static String getRootPath(String path) {
if (path.indexOf('/') > -1) {
return path.substring(0, path.lastIndexOf('/'));
|