From 5f8d99338e63c68839e3ddf34f54486e1d1128f1 Mon Sep 17 00:00:00 2001
From: James Moger <james.moger@gitblit.com>
Date: Tue, 17 Sep 2013 17:03:57 -0400
Subject: [PATCH] Merge branch 'userrepoprefix' of https://github.com/fzs/gitblit into prefixes

---
 src/main/java/com/gitblit/models/UserModel.java |    7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/src/main/java/com/gitblit/models/UserModel.java b/src/main/java/com/gitblit/models/UserModel.java
index 6d58512..d785ae9 100644
--- a/src/main/java/com/gitblit/models/UserModel.java
+++ b/src/main/java/com/gitblit/models/UserModel.java
@@ -35,6 +35,7 @@
 import com.gitblit.Constants.RegistrantType;
 import com.gitblit.Constants.Unused;
 import com.gitblit.utils.ArrayUtils;
+import com.gitblit.utils.ModelUtils;
 import com.gitblit.utils.StringUtils;
 
 /**
@@ -567,7 +568,7 @@
 		}
 		if (canCreate) {
 			String projectPath = StringUtils.getFirstPathElement(repository);
-			if (!StringUtils.isEmpty(projectPath) && projectPath.equalsIgnoreCase("~" + username)) {
+			if (!StringUtils.isEmpty(projectPath) && projectPath.equalsIgnoreCase(getPersonalPath())) {
 				// personal repository
 				return true;
 			}
@@ -609,7 +610,7 @@
 	}
 	
 	public String getPersonalPath() {
-		return "~" + username;
+		return ModelUtils.getPersonalPath(username);
 	}
 	
 	public UserPreferences getPreferences() {
@@ -675,6 +676,6 @@
 	
 	public boolean isMyPersonalRepository(String repository) {
 		String projectPath = StringUtils.getFirstPathElement(repository);
-		return !StringUtils.isEmpty(projectPath) && projectPath.equalsIgnoreCase("~" + username);
+		return !StringUtils.isEmpty(projectPath) && projectPath.equalsIgnoreCase(getPersonalPath());
 	}
 }

--
Gitblit v1.9.1