diff --git a/scm-plugins/scm-git-plugin/src/main/js/RepositoryConfig.tsx b/scm-plugins/scm-git-plugin/src/main/js/RepositoryConfig.tsx index f8f76db250..17a01e5bef 100644 --- a/scm-plugins/scm-git-plugin/src/main/js/RepositoryConfig.tsx +++ b/scm-plugins/scm-git-plugin/src/main/js/RepositoryConfig.tsx @@ -73,25 +73,28 @@ class RepositoryConfig extends React.Component { componentDidMount() { const { repository } = this.props; - this.setState({ - loadingBranches: true, - }); const branchesLink = repository._links.branches as Link; - apiClient - .get(branchesLink.href) - .then((response) => response.json()) - .then((payload) => payload._embedded.branches) - .then((branches) => - this.setState({ - branches, - loadingBranches: false, - }) - ) - .catch((error) => - this.setState({ - error, - }) - ); + if (branchesLink) { + apiClient + .get(branchesLink.href) + .then((response) => response.json()) + .then((payload) => payload._embedded.branches) + .then((branches) => + this.setState({ + branches, + loadingBranches: false, + }) + ) + .catch((error) => + this.setState({ + error, + }) + ); + } else { + this.setState({ + loadingBranches: false, + }); + } const configurationLink = repository._links.configuration as Link; this.setState({ diff --git a/scm-ui/ui-webapp/src/repos/containers/RepositoryRoot.tsx b/scm-ui/ui-webapp/src/repos/containers/RepositoryRoot.tsx index 629cc776cc..82a22c04b2 100644 --- a/scm-ui/ui-webapp/src/repos/containers/RepositoryRoot.tsx +++ b/scm-ui/ui-webapp/src/repos/containers/RepositoryRoot.tsx @@ -118,8 +118,10 @@ const RepositoryRoot = () => { let redirectedUrl; if (redirectUrlFactory) { redirectedUrl = url + redirectUrlFactory(props); - } else { + } else if (repository._links.sources) { redirectedUrl = url + "/code/sources/"; + } else { + redirectedUrl = url + "/info"; } const fileControlFactoryFactory: (changeset: Changeset) => FileControlFactory = changeset => file => { diff --git a/scm-webapp/src/main/java/sonia/scm/api/v2/resources/RepositoryToRepositoryDtoMapper.java b/scm-webapp/src/main/java/sonia/scm/api/v2/resources/RepositoryToRepositoryDtoMapper.java index 47bfd36a94..19be0ee11e 100644 --- a/scm-webapp/src/main/java/sonia/scm/api/v2/resources/RepositoryToRepositoryDtoMapper.java +++ b/scm-webapp/src/main/java/sonia/scm/api/v2/resources/RepositoryToRepositoryDtoMapper.java @@ -134,34 +134,34 @@ public abstract class RepositoryToRepositoryDtoMapper extends BaseMapper