aboutsummaryrefslogtreecommitdiffstats
path: root/models
diff options
context:
space:
mode:
authorzeripath <art27@cantab.net>2020-07-02 15:09:09 +0100
committerGitHub <noreply@github.com>2020-07-02 15:09:09 +0100
commit482ba937ed118d68448c5fe347ee7e43f5621c0b (patch)
tree328ac6693790909f816faedea45520493ac1f478 /models
parenta87a64e6a1f2e3e673fc24818bd17f7225f921f6 (diff)
downloadgitea-482ba937ed118d68448c5fe347ee7e43f5621c0b.tar.gz
gitea-482ba937ed118d68448c5fe347ee7e43f5621c0b.zip
Provide option to unlink a fork (#11858)
* Provide option to unlink a fork Fix #4566 Signed-off-by: Andrew Thornton <art27@cantab.net> * Apply suggestions from code review Co-authored-by: techknowlogick <matti@mdranta.net> * Add check that user can create repo Signed-off-by: Andrew Thornton <art27@cantab.net> * as per @cirnoT Signed-off-by: Andrew Thornton <art27@cantab.net> Co-authored-by: techknowlogick <matti@mdranta.net>
Diffstat (limited to 'models')
-rw-r--r--models/repo.go12
1 files changed, 1 insertions, 11 deletions
diff --git a/models/repo.go b/models/repo.go
index 3b874f3359..c7d2ef467c 100644
--- a/models/repo.go
+++ b/models/repo.go
@@ -209,19 +209,9 @@ func (repo *Repository) SanitizedOriginalURL() string {
// ColorFormat returns a colored string to represent this repo
func (repo *Repository) ColorFormat(s fmt.State) {
- var ownerName interface{}
-
- if repo.OwnerName != "" {
- ownerName = repo.OwnerName
- } else if repo.Owner != nil {
- ownerName = repo.Owner.Name
- } else {
- ownerName = log.NewColoredIDValue(strconv.FormatInt(repo.OwnerID, 10))
- }
-
log.ColorFprintf(s, "%d:%s/%s",
log.NewColoredIDValue(repo.ID),
- ownerName,
+ repo.OwnerName,
repo.Name)
}