File tree Expand file tree Collapse file tree 3 files changed +15
-3
lines changed Expand file tree Collapse file tree 3 files changed +15
-3
lines changed Original file line number Diff line number Diff line change @@ -1235,6 +1235,7 @@ create_new_repo_command = Creating a new repository on the command line
12351235push_exist_repo = Pushing an existing repository from the command line
12361236empty_message = This repository does not contain any content.
12371237broken_message = The Git data underlying this repository cannot be read. Contact the administrator of this instance or delete this repository.
1238+ no_branch = This repository doesn’t have any branches.
12381239
12391240code = Code
12401241code.desc = Access source code, files, commits and branches.
Original file line number Diff line number Diff line change @@ -240,6 +240,11 @@ func handleRepoEmptyOrBroken(ctx *context.Context) {
240240 return
241241 }
242242
243+ if v , ok := ctx .Data ["BranchesCount" ]; ok && v .(int64 ) == 0 {
244+ ctx .HTML (http .StatusOK , tplRepoEMPTY )
245+ return
246+ }
247+
243248 // the repo is not really empty, so we should update the modal in database
244249 // such problem may be caused by:
245250 // 1) an error occurs during pushing/receiving. 2) the user replaces an empty git repo manually
Original file line number Diff line number Diff line change 1515 </div>
1616 {{end}}
1717 {{if .Repository.IsBroken}}
18- <div class =" ui segment center" >
19- {{ ctx.Locale.Tr " repo.broken_message" }}
20- </div >
18+ {{if (not .BranchesCount)}}
19+ <div class="ui segment center">
20+ {{ctx.Locale.Tr "repo.no_branch"}}
21+ </div>
22+ {{else}}
23+ <div class="ui segment center">
24+ {{ctx.Locale.Tr "repo.broken_message"}}
25+ </div>
26+ {{end}}
2127 {{else if .CanWriteCode}}
2228 <h4 class="ui top attached header">
2329 {{ctx.Locale.Tr "repo.quick_guide"}}
You can’t perform that action at this time.
0 commit comments