]> source.dussan.org Git - gitblit.git/commitdiff
Remove fork reference from origin repository on rename
authorJames Moger <james.moger@gitblit.com>
Fri, 5 Oct 2012 21:31:04 +0000 (17:31 -0400)
committerJames Moger <james.moger@gitblit.com>
Fri, 5 Oct 2012 21:31:04 +0000 (17:31 -0400)
src/com/gitblit/GitBlit.java

index 5a4135657dae81374bb1b3cbc6754291318d34e6..e945fa06f29ac252f3475eef698c4baa3cb30556 100644 (file)
@@ -1614,6 +1614,14 @@ public class GitBlit implements ServletContextListener {
                                                rf.close();\r
                                        }\r
                                }\r
+                               \r
+                               // remove this repository from any origin model's fork list\r
+                               if (!StringUtils.isEmpty(repository.originRepository)) {\r
+                                       RepositoryModel origin = repositoryListCache.get(repository.originRepository);\r
+                                       if (origin != null && !ArrayUtils.isEmpty(origin.forks)) {\r
+                                               origin.forks.remove(repositoryName);\r
+                                       }\r
+                               }\r
 \r
                                // clear the cache\r
                                clearRepositoryMetadataCache(repositoryName);\r