summaryrefslogtreecommitdiffstats
path: root/src/com/gitblit
diff options
context:
space:
mode:
authorJames Moger <james.moger@gitblit.com>2012-10-05 17:31:04 -0400
committerJames Moger <james.moger@gitblit.com>2012-10-05 17:31:04 -0400
commitdd79f46d8e39b041fcdc349d18f76dfbc038667e (patch)
treea980285dc6a35e0cba0c8410265fb9c3dd0b119c /src/com/gitblit
parent88aad76a0e54b4a8757bbc9ea45fec8f70baa832 (diff)
downloadgitblit-dd79f46d8e39b041fcdc349d18f76dfbc038667e.tar.gz
gitblit-dd79f46d8e39b041fcdc349d18f76dfbc038667e.zip
Remove fork reference from origin repository on rename
Diffstat (limited to 'src/com/gitblit')
-rw-r--r--src/com/gitblit/GitBlit.java8
1 files changed, 8 insertions, 0 deletions
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);