From 889e695280f9b82cc31aeb5e8a28b60f8cd6c260 Mon Sep 17 00:00:00 2001
From: James Moger <james.moger@gitblit.com>
Date: Sat, 13 Jul 2013 13:10:04 -0400
Subject: [PATCH] Adjust unit test to confirm null permission fix (issue-259)

---
 src/main/java/com/gitblit/GitBlit.java |   12 ++++++++++--
 1 files changed, 10 insertions(+), 2 deletions(-)

diff --git a/src/main/java/com/gitblit/GitBlit.java b/src/main/java/com/gitblit/GitBlit.java
index ca21717..301591f 100644
--- a/src/main/java/com/gitblit/GitBlit.java
+++ b/src/main/java/com/gitblit/GitBlit.java
@@ -121,6 +121,7 @@
 import com.gitblit.utils.FederationUtils;
 import com.gitblit.utils.HttpUtils;
 import com.gitblit.utils.JGitUtils;
+import com.gitblit.utils.JGitUtils.LastChange;
 import com.gitblit.utils.JsonUtils;
 import com.gitblit.utils.MetricUtils;
 import com.gitblit.utils.ObjectCache;
@@ -1669,7 +1670,9 @@
 				model.hasCommits = JGitUtils.hasCommits(r);
 			}
 
-			model.lastChange = JGitUtils.getLastChange(r);
+			LastChange lc = JGitUtils.getLastChange(r);
+			model.lastChange = lc.when;
+			model.lastChangeAuthor = lc.who;
 			if (!model.skipSizeCalculation) {
 				ByteFormat byteFormat = new ByteFormat();
 				model.size = byteFormat.format(calculateSize(model));
@@ -1973,7 +1976,9 @@
 			model.name = repositoryName;
 		}
 		model.hasCommits = JGitUtils.hasCommits(r);
-		model.lastChange = JGitUtils.getLastChange(r);
+		LastChange lc = JGitUtils.getLastChange(r);
+		model.lastChange = lc.when;
+		model.lastChangeAuthor = lc.who;
 		model.projectPath = StringUtils.getFirstPathElement(repositoryName);
 		
 		StoredConfig config = r.getConfig();
@@ -2047,6 +2052,9 @@
 					File repoFolder = new File(getRepositoriesFolder(), originRepo);
 					if (repoFolder.exists()) {
 						model.originRepository = originRepo.toLowerCase();
+						
+						// persist the fork origin
+						updateConfiguration(r, model);
 					}
 				}
 			} catch (URISyntaxException e) {

--
Gitblit v1.9.1