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>
This commit is contained in:
parent
a87a64e6a1
commit
482ba937ed
5 changed files with 124 additions and 48 deletions
|
@ -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)
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue