From dd79f46d8e39b041fcdc349d18f76dfbc038667e Mon Sep 17 00:00:00 2001 From: James Moger Date: Fri, 5 Oct 2012 17:31:04 -0400 Subject: [PATCH] Remove fork reference from origin repository on rename --- src/com/gitblit/GitBlit.java | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/com/gitblit/GitBlit.java b/src/com/gitblit/GitBlit.java index 5a413565..e945fa06 100644 --- a/src/com/gitblit/GitBlit.java +++ b/src/com/gitblit/GitBlit.java @@ -1614,6 +1614,14 @@ public class GitBlit implements ServletContextListener { rf.close(); } } + + // remove this repository from any origin model's fork list + if (!StringUtils.isEmpty(repository.originRepository)) { + RepositoryModel origin = repositoryListCache.get(repository.originRepository); + if (origin != null && !ArrayUtils.isEmpty(origin.forks)) { + origin.forks.remove(repositoryName); + } + } // clear the cache clearRepositoryMetadataCache(repositoryName); -- 2.39.5