From dd79f46d8e39b041fcdc349d18f76dfbc038667e Mon Sep 17 00:00:00 2001 From: James Moger <james.moger@gitblit.com> Date: Fri, 05 Oct 2012 17:31:04 -0400 Subject: [PATCH] Remove fork reference from origin repository on rename --- src/com/gitblit/GitBlit.java | 8 ++++++++ 1 files changed, 8 insertions(+), 0 deletions(-) diff --git a/src/com/gitblit/GitBlit.java b/src/com/gitblit/GitBlit.java index 5a41356..e945fa0 100644 --- a/src/com/gitblit/GitBlit.java +++ b/src/com/gitblit/GitBlit.java @@ -1614,6 +1614,14 @@ 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); -- Gitblit v1.9.1