Skip to content

Commit

Permalink
Add ability to fork your own repos (#761)
Browse files Browse the repository at this point in the history
  • Loading branch information
Bwko authored and lunny committed Jan 26, 2017
1 parent d1b5498 commit e084210
Show file tree
Hide file tree
Showing 23 changed files with 1 addition and 28 deletions.
1 change: 0 additions & 1 deletion options/locale/locale_bg-BG.ini
Original file line number Diff line number Diff line change
Expand Up @@ -391,7 +391,6 @@ migrate.failed=Грешка при миграция: %v

mirror_from=огледало от
forked_from=разклонено от
fork_from_self=Не можете да разклоните хранилище което си е Ваше!
copy_link=Копирай
copy_link_success=Копирано!
copy_link_error=Натиснете ⌘-C или Ctrl-C за да копирате
Expand Down
1 change: 0 additions & 1 deletion options/locale/locale_cs-CZ.ini
Original file line number Diff line number Diff line change
Expand Up @@ -391,7 +391,6 @@ migrate.failed=Přenesení selhalo: %v
mirror_from=zrcadlo
forked_from=rozštěpen z
fork_from_self=Nemůžete rozštěpit repositář, který již vlastníte!
copy_link=Kopie
copy_link_success=Zkopírováno!
copy_link_error=Pro zkopírování stiskněte ⌘-C nebo Ctrl-C
Expand Down
1 change: 0 additions & 1 deletion options/locale/locale_de-DE.ini
Original file line number Diff line number Diff line change
Expand Up @@ -391,7 +391,6 @@ migrate.failed=Fehler bei Migration: %v

mirror_from=Mirror von
forked_from=geforkt von
fork_from_self=Sie können kein Repository forken, das Ihnen gehört!
copy_link=Kopieren
copy_link_success=Kopiert!
copy_link_error=Drücken Sie ⌘-C oder Strg-C zum Kopieren
Expand Down
1 change: 0 additions & 1 deletion options/locale/locale_en-US.ini
Original file line number Diff line number Diff line change
Expand Up @@ -433,7 +433,6 @@ migrate.failed = Migration failed: %v
mirror_from = mirror of
forked_from = forked from
fork_from_self = You cannot fork a repository you already own!
copy_link = Copy
copy_link_success = Copied!
copy_link_error = Press ⌘-C or Ctrl-C to copy
Expand Down
1 change: 0 additions & 1 deletion options/locale/locale_es-ES.ini
Original file line number Diff line number Diff line change
Expand Up @@ -391,7 +391,6 @@ migrate.failed=Migración fallida: %v

mirror_from=espejo de
forked_from=forked de
fork_from_self=¡No puedes crear un fork de un repositorio que ya es tuyo!
copy_link=Copiar
copy_link_success=¡Copiado!
copy_link_error=Presione ⌘ + C o Ctrl-C para copiar
Expand Down
1 change: 0 additions & 1 deletion options/locale/locale_fi-FI.ini
Original file line number Diff line number Diff line change
Expand Up @@ -391,7 +391,6 @@ migrate.failed=Siirto epäonnistui: %v

mirror_from=peilaus alkaen
forked_from=forkattu lähteestä
fork_from_self=Et voi forkata repoa jonka jo omistat!
copy_link=Kopioi
copy_link_success=Kopioitu!
copy_link_error=Paina ⌘-C tai Ctrl-C kopioidaksesi
Expand Down
1 change: 0 additions & 1 deletion options/locale/locale_fr-FR.ini
Original file line number Diff line number Diff line change
Expand Up @@ -391,7 +391,6 @@ migrate.failed=Echec de migration: %v
mirror_from=miroir de
forked_from=forké depuis
fork_from_self=Vous ne pouvez pas forker un dépôt que vous possédez déja !
copy_link=Copier
copy_link_success=Copié!
copy_link_error=Appuyez sur ⌘-C ou Ctrl-C pour copier
Expand Down
1 change: 0 additions & 1 deletion options/locale/locale_it-IT.ini
Original file line number Diff line number Diff line change
Expand Up @@ -391,7 +391,6 @@ migrate.failed=Migrazione non riuscita: %v
mirror_from=mirror da
forked_from=forkato da
fork_from_self=Non puoi forkare il tuo stesso repository!
copy_link=Copia
copy_link_success=Copiato!
copy_link_error=Premere ⌘-C o Ctrl-C per copiare
Expand Down
1 change: 0 additions & 1 deletion options/locale/locale_ja-JP.ini
Original file line number Diff line number Diff line change
Expand Up @@ -391,7 +391,6 @@ migrate.failed=移行に失敗しました: %v

mirror_from=同期ミラー
forked_from=フォーク元
fork_from_self=すでにあなたの所有しているリポジトリはフォークできません
copy_link=コピー
copy_link_success=コピーされました!
copy_link_error=⌘ C または Ctrl-C キーを押してコピー
Expand Down
1 change: 0 additions & 1 deletion options/locale/locale_ko-KR.ini
Original file line number Diff line number Diff line change
Expand Up @@ -391,7 +391,6 @@ migrate.failed=마이그레이션 실패: %v

mirror_from=의 미러
forked_from=원본 프로젝트 :
fork_from_self=본인의 저장소는 포크할 수 없습니다!
copy_link=복사
copy_link_success=복사됨!
copy_link_error=⌘-C 나 Ctrl-C를 눌러 복사
Expand Down
1 change: 0 additions & 1 deletion options/locale/locale_lv-LV.ini
Original file line number Diff line number Diff line change
Expand Up @@ -391,7 +391,6 @@ migrate.failed=Migrācija neizdevās: %v

mirror_from=spogulis no
forked_from=atdalīts no
fork_from_self=Nav iespējams atdalīt repozitoriju, kuram esat īpašnieks!
copy_link=Kopēt
copy_link_success=Nokopēts!
copy_link_error=Nospiediet ⌘-C vai Ctrl-C, lai nokopētu
Expand Down
1 change: 0 additions & 1 deletion options/locale/locale_nl-NL.ini
Original file line number Diff line number Diff line change
Expand Up @@ -392,7 +392,6 @@ migrate.failed=Migratie is mislukt: %v
mirror_from=kopie van
forked_from=geforked van
fork_from_self=U kunt geen repository forken die van u zelf is!
copy_link=Kopieer
copy_link_success=Gekopieerd!
copy_link_error=Druk op ⌘-C of Ctrl-C om te kopiëren
Expand Down
1 change: 0 additions & 1 deletion options/locale/locale_pl-PL.ini
Original file line number Diff line number Diff line change
Expand Up @@ -391,7 +391,6 @@ migrate.failed=Migracja nie powiodła się: %v

mirror_from=kopia lustrzana
forked_from=sklonowany z
fork_from_self=Nie możesz forkować swojego własnego repozytorium!
copy_link=Kopiuj
copy_link_success=Skopiowane!
copy_link_error=Naciśnij klawisze ⌘-C i Ctrl-C, aby skopiować
Expand Down
1 change: 0 additions & 1 deletion options/locale/locale_pt-BR.ini
Original file line number Diff line number Diff line change
Expand Up @@ -392,7 +392,6 @@ migrate.failed=Migração falhou: %v

mirror_from=mirror de
forked_from=fork de
fork_from_self=Você não pode criar fork de um repositório que já é seu!
copy_link=Copiar
copy_link_success=Copiado!
copy_link_error=Pressione ⌘-C ou Ctrl-C para copiar
Expand Down
1 change: 0 additions & 1 deletion options/locale/locale_ru-RU.ini
Original file line number Diff line number Diff line change
Expand Up @@ -397,7 +397,6 @@ migrate.failed=Миграция не удалась: %v

mirror_from=зеркало из
forked_from=ответвлено от
fork_from_self=Вы не можете ответвить репозиторий, так как Вы уже его владелец!
copy_link=Скопировать
copy_link_success=Скопировано!
copy_link_error=Нажмите ⌘-C или Ctrl-C для копирования
Expand Down
1 change: 0 additions & 1 deletion options/locale/locale_sr-SP.ini
Original file line number Diff line number Diff line change
Expand Up @@ -391,7 +391,6 @@ migrate.failed=Миграција није успела: %v

mirror_from=огледало од
forked_from=изданак од
fork_from_self=Ви не можете да креирате огранак спремишта ако сте већ његов власник!
copy_link=Копирај
copy_link_success=Ископирано!
copy_link_error=Кликните ⌘-C или Ctrl-C да копирате
Expand Down
1 change: 0 additions & 1 deletion options/locale/locale_sv-SE.ini
Original file line number Diff line number Diff line change
Expand Up @@ -391,7 +391,6 @@ migrate.failed=Migrering misslyckades: %v
mirror_from=spegling av
forked_from=forkad från
fork_from_self=Du kan inte forka ett repo som du redan äger!
copy_link=Kopiera
copy_link_success=Kopierad!
copy_link_error=Tryck på ⌘-C eller Ctrl-C för att kopiera
Expand Down
1 change: 0 additions & 1 deletion options/locale/locale_tr-TR.ini
Original file line number Diff line number Diff line change
Expand Up @@ -391,7 +391,6 @@ migrate.failed=Göç başarısız: %v

mirror_from=şunun yansıması
forked_from=şundan çatallanmış
fork_from_self=Sahibi olduğunuz bir depoyu çatallayamazsınız!
copy_link=Kopyala
copy_link_success=Kopyalandı!
copy_link_error=Kopyalamak için ⌘-C veya Ctrl-C tuşlarına basın
Expand Down
1 change: 0 additions & 1 deletion options/locale/locale_zh-CN.ini
Original file line number Diff line number Diff line change
Expand Up @@ -397,7 +397,6 @@ migrate.failed=迁移失败:%v

mirror_from=镜像自地址
forked_from=派生自
fork_from_self=无法派生已经拥有的仓库!
copy_link=复制链接
copy_link_success=复制成功!
copy_link_error=请按下 ⌘-C 或 Ctrl-C 复制
Expand Down
1 change: 0 additions & 1 deletion options/locale/locale_zh-HK.ini
Original file line number Diff line number Diff line change
Expand Up @@ -397,7 +397,6 @@ migrate.failed=遷移失敗:%v

mirror_from=镜像来自
forked_from=複製自
fork_from_self=無法複製已經擁有的儲存庫!
copy_link=複製連結
copy_link_success=複製成功!
copy_link_error=請按下 ⌘-C 或 Ctrl-C 複製
Expand Down
1 change: 0 additions & 1 deletion options/locale/locale_zh-TW.ini
Original file line number Diff line number Diff line change
Expand Up @@ -397,7 +397,6 @@ migrate.failed=遷移失敗:%v

mirror_from=镜像来自
forked_from=複製自
fork_from_self=無法複製已經擁有的儲存庫!
copy_link=複製連結
copy_link_success=複製成功!
copy_link_error=請按下 ⌘-C 或 Ctrl-C 複製
Expand Down
6 changes: 0 additions & 6 deletions routers/repo/pull.go
Original file line number Diff line number Diff line change
Expand Up @@ -109,12 +109,6 @@ func ForkPost(ctx *context.Context, form auth.CreateRepoForm) {
return
}

repo, has := models.HasForkedRepo(ctxUser.ID, forkRepo.ID)
if has {
ctx.Redirect(setting.AppSubURL + "/" + ctxUser.Name + "/" + repo.Name)
return
}

// Check ownership of organization.
if ctxUser.IsOrganization() {
if !ctxUser.IsOwnedBy(ctx.User.ID) {
Expand Down
2 changes: 1 addition & 1 deletion templates/repo/header.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
</div>
{{if .CanBeForked}}
<div class="ui labeled button" tabindex="0">
<a class="ui button {{if eq .OwnerID $.SignedUserID}}poping up{{end}}" {{if not (eq .OwnerID $.SignedUserID)}}href="{{AppSubUrl}}/repo/fork/{{.ID}}"{{else}} data-content="{{$.i18n.Tr "repo.fork_from_self"}}" data-position="top center" data-variation="tiny"{{end}}>
<a class="ui button" href="{{AppSubUrl}}/repo/fork/{{.ID}}">
<i class="octicon octicon-repo-forked"></i>{{$.i18n.Tr "repo.fork"}}
</a>
<a class="ui basic label" href="{{.Link}}/forks">
Expand Down

0 comments on commit e084210

Please sign in to comment.