final Project.NameKey projectName = projectState.getProject().getNameKey();
Repository git;
try {
git = gitRepositoryManager.openRepository(projectName);
} catch (RepositoryNotFoundException err) {
throw new NoSuchProjectException(projectName);
}
try {
Ref head = git.getRef(Constants.HEAD);
if (head != null && head.isSymbolic()
&& GitRepositoryManager.REF_CONFIG.equals(head.getLeaf().getName())) {
detail.setPermissionOnly(true);
}
} catch (IOException err) {
throw new NoSuchProjectException(projectName);
} finally {
git.close();
}
return detail;