From: James Moger Date: Fri, 5 Oct 2012 21:31:04 +0000 (-0400) Subject: Remove fork reference from origin repository on rename X-Git-Tag: v1.2.0~178 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=dd79f46d8e39b041fcdc349d18f76dfbc038667e;p=gitblit.git Remove fork reference from origin repository on rename --- 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);