Merge pull request !2849 from rhodecode-enterprise-ce feature/git-default-branch

Setting for default branch and creating new repo+commits on empty repo
This commit is contained in:
Andrii Verbytskyi 2025-10-31 16:00:29 +00:00
commit 126269feef
9 changed files with 210 additions and 15 deletions

View file

@ -1293,7 +1293,7 @@ class RepoFilesView(RepoAppView):
c.commit = self._get_commit_or_redirect(commit_id, redirect_after=False)
if c.commit is None:
c.commit = EmptyCommit(alias=self.rhodecode_vcs_repo.alias)
c.commit = EmptyCommit(alias=self.rhodecode_vcs_repo.alias, branch=self.db_repo.landing_ref_name)
if self.rhodecode_vcs_repo.is_empty():
# for empty repository we cannot check for current branch, we rely on
@ -1329,7 +1329,7 @@ class RepoFilesView(RepoAppView):
c.commit = self._get_commit_or_redirect(commit_id, redirect_after=False)
if c.commit is None:
c.commit = EmptyCommit(alias=self.rhodecode_vcs_repo.alias)
c.commit = EmptyCommit(alias=self.rhodecode_vcs_repo.alias, branch=self.db_repo.landing_ref_name)
# calculate redirect URL
if self.rhodecode_vcs_repo.is_empty():
@ -1415,7 +1415,7 @@ class RepoFilesView(RepoAppView):
c.commit = self._get_commit_or_redirect(commit_id, redirect_after=False)
if c.commit is None:
c.commit = EmptyCommit(alias=self.rhodecode_vcs_repo.alias)
c.commit = EmptyCommit(alias=self.rhodecode_vcs_repo.alias, branch=self.db_repo.landing_ref_name)
# calculate redirect URL
if self.rhodecode_vcs_repo.is_empty():
@ -1517,7 +1517,7 @@ class RepoFilesView(RepoAppView):
c.commit = self._get_commit_or_redirect(commit_id, redirect_after=False)
if c.commit is None:
c.commit = EmptyCommit(alias=self.rhodecode_vcs_repo.alias)
c.commit = EmptyCommit(alias=self.rhodecode_vcs_repo.alias, branch=self.db_repo.landing_ref_name)
if self.rhodecode_vcs_repo.is_empty():
default_redirect_url = h.route_path("repo_summary", repo_name=self.db_repo_name)