import com.gitblit.utils.BugtraqProcessor;\r
import com.gitblit.utils.DeepCopier;\r
import com.gitblit.utils.JGitUtils;\r
+import com.gitblit.utils.ModelUtils;\r
import com.gitblit.utils.RefLogUtils;\r
import com.gitblit.utils.StringUtils;\r
import com.gitblit.wicket.CacheControl;\r
add(new ExternalLink("myForkLink", "").setVisible(false));\r
} else {\r
String fork = app().repositories().getFork(user.username, model.name);\r
+ String userRepo = ModelUtils.getPersonalPath(user.username) + "/" + StringUtils.stripDotGit(StringUtils.getLastPathElement(model.name));\r
+ boolean hasUserRepo = app().repositories().hasRepository(userRepo);\r
boolean hasFork = fork != null;\r
- boolean canFork = user.canFork(model) && model.hasCommits;\r
+ boolean canFork = user.canFork(model) && model.hasCommits && !hasUserRepo;\r
\r
if (hasFork || !canFork) {\r
// user not allowed to fork or fork already exists or repo forbids forking\r