From cb285cbfddfc0b633d6b8cdb4dc0d2bd2b8b51ef Mon Sep 17 00:00:00 2001
From: James Moger <james.moger@gitblit.com>
Date: Thu, 05 Jan 2012 17:34:05 -0500
Subject: [PATCH] Fixed bug in receive hook for repositories in subfolders

---
 src/com/gitblit/models/PathModel.java |   24 ++++++++++++++----------
 1 files changed, 14 insertions(+), 10 deletions(-)

diff --git a/src/com/gitblit/models/PathModel.java b/src/com/gitblit/models/PathModel.java
index 17a7971..c78b300 100644
--- a/src/com/gitblit/models/PathModel.java
+++ b/src/com/gitblit/models/PathModel.java
@@ -20,6 +20,13 @@
 import org.eclipse.jgit.diff.DiffEntry.ChangeType;
 import org.eclipse.jgit.lib.FileMode;
 
+/**
+ * PathModel is a serializable model class that represents a file or a folder,
+ * including all its metadata and associated commit id.
+ * 
+ * @author James Moger
+ * 
+ */
 public class PathModel implements Serializable, Comparable<PathModel> {
 
 	private static final long serialVersionUID = 1L;
@@ -41,16 +48,6 @@
 
 	public boolean isTree() {
 		return FileMode.TREE.equals(mode);
-	}
-
-	public static PathModel getParentPath(String basePath, String commitId) {
-		String parentPath = null;
-		if (basePath.lastIndexOf('/') > -1) {
-			parentPath = basePath.substring(0, basePath.lastIndexOf('/'));
-		}
-		PathModel model = new PathModel("..", parentPath, 0, 40000, commitId);
-		model.isParentPath = true;
-		return model;
 	}
 
 	@Override
@@ -81,6 +78,13 @@
 		return 1;
 	}
 
+	/**
+	 * PathChangeModel is a serializable class that represents a file changed in
+	 * a commit.
+	 * 
+	 * @author James Moger
+	 * 
+	 */
 	public static class PathChangeModel extends PathModel {
 
 		private static final long serialVersionUID = 1L;

--
Gitblit v1.9.1