mirror of
https://github.com/go-gitea/gitea.git
synced 2026-10-03 00:02:43 +02:00
#1021 Forked repo unavailable after deleting original repo
This commit is contained in:
1 parent
dde9ace91b
commit
398569f6f8
14 files changed
+262
-137
No files matched your search
@@ -319,6 +319,7 @@ repo_name = Repository Name
|
||||
repo_name_helper = A good repository name is usually composed of short, memorable and unique keywords.
|
||||
visibility = Visibility
|
||||
visiblity_helper = This repository is <span class="ui red text">Private</span>
|
||||
visiblity_fork_helper = (Change of this value will affect all forks)
|
||||
fork_repo = Fork Repository
|
||||
fork_from = Fork From
|
||||
fork_visiblity_helper = You cannot alter the visibility of a forked repository.
|
||||
@@ -508,6 +509,9 @@ settings.transfer_notices_2 = - You will conserve access if new owner is an orga
|
||||
settings.transfer_form_title = Please enter following information to confirm your operation:
|
||||
settings.delete_notices_1 = - This operation <strong>CANNOT</strong> be undone.
|
||||
settings.delete_notices_2 = - This operation will permanently delete the everything of this repository, including Git data, issues, comments and accesses of collaborators.
|
||||
settings.delete_notices_fork_1 = - If this repository is public, all forks will be became independent after deletion.
|
||||
settings.delete_notices_fork_2 = - If this repository is private, all forks will be removed at the same time.
|
||||
settings.delete_notices_fork_3 = - If you want to keep all forks after deletion, please change visibility of this repository to public first.
|
||||
settings.update_settings_success = Repository options has been updated successfully.
|
||||
settings.transfer_owner = New Owner
|
||||
settings.make_transfer = Make Transfer
|
||||
|
||||
+24
-23
@@ -158,6 +158,30 @@ func NewRepoAction(u *User, repo *Repository) (err error) {
|
||||
return newRepoAction(x, u, repo)
|
||||
}
|
||||
|
||||
func renameRepoAction(e Engine, actUser *User, oldRepoName string, repo *Repository) (err error) {
|
||||
if err = notifyWatchers(e, &Action{
|
||||
ActUserID: actUser.Id,
|
||||
ActUserName: actUser.Name,
|
||||
ActEmail: actUser.Email,
|
||||
OpType: RENAME_REPO,
|
||||
RepoID: repo.ID,
|
||||
RepoUserName: repo.Owner.Name,
|
||||
RepoName: repo.Name,
|
||||
IsPrivate: repo.IsPrivate,
|
||||
Content: oldRepoName,
|
||||
}); err != nil {
|
||||
return fmt.Errorf("notify watchers: %v", err)
|
||||
}
|
||||
|
||||
log.Trace("action.renameRepoAction: %s/%s", actUser.Name, repo.Name)
|
||||
return nil
|
||||
}
|
||||
|
||||
// RenameRepoAction adds new action for renaming a repository.
|
||||
func RenameRepoAction(actUser *User, oldRepoName string, repo *Repository) error {
|
||||
return renameRepoAction(x, actUser, oldRepoName, repo)
|
||||
}
|
||||
|
||||
// updateIssuesCommit checks if issues are manipulated by commit message.
|
||||
func updateIssuesCommit(u *User, repo *Repository, repoUserName, repoName string, commits []*base.PushCommit) error {
|
||||
for _, c := range commits {
|
||||
@@ -502,29 +526,6 @@ func TransferRepoAction(actUser, oldOwner, newOwner *User, repo *Repository) err
|
||||
return transferRepoAction(x, actUser, oldOwner, newOwner, repo)
|
||||
}
|
||||
|
||||
func renameRepoAction(e Engine, actUser *User, oldRepoName string, repo *Repository) (err error) {
|
||||
if err = notifyWatchers(e, &Action{
|
||||
ActUserID: actUser.Id,
|
||||
ActUserName: actUser.Name,
|
||||
ActEmail: actUser.Email,
|
||||
OpType: RENAME_REPO,
|
||||
RepoUserName: repo.Owner.Name,
|
||||
RepoName: repo.Name,
|
||||
IsPrivate: repo.IsPrivate,
|
||||
Content: oldRepoName,
|
||||
}); err != nil {
|
||||
return fmt.Errorf("notify watchers: %v", err)
|
||||
}
|
||||
|
||||
log.Trace("action.renameRepoAction: %s/%s", actUser.Name, repo.Name)
|
||||
return nil
|
||||
}
|
||||
|
||||
// RenameRepoAction adds new action for renaming a repository.
|
||||
func RenameRepoAction(actUser *User, oldRepoName string, repo *Repository) error {
|
||||
return renameRepoAction(x, actUser, oldRepoName, repo)
|
||||
}
|
||||
|
||||
// GetFeeds returns action list of given user in given context.
|
||||
func GetFeeds(uid, offset int64, isProfile bool) ([]*Action, error) {
|
||||
actions := make([]*Action, 0, 20)
|
||||
|
||||
+1
-1
@@ -78,7 +78,7 @@ func init() {
|
||||
tables = append(tables,
|
||||
new(User), new(PublicKey), new(Oauth2), new(AccessToken),
|
||||
new(Repository), new(DeployKey), new(Collaboration), new(Access),
|
||||
new(Watch), new(Star), new(Follow), new(Action),
|
||||
new(Watch), new(Star), new(ForkInfo), new(Follow), new(Action),
|
||||
new(Issue), new(Comment), new(Attachment), new(IssueUser),
|
||||
new(Label), new(IssueLabel), new(Milestone),
|
||||
new(Mirror), new(Release), new(LoginSource), new(Webhook),
|
||||
|
||||
+163
-68
@@ -160,6 +160,7 @@ type Repository struct {
|
||||
IsFork bool `xorm:"NOT NULL DEFAULT false"`
|
||||
ForkID int64
|
||||
BaseRepo *Repository `xorm:"-"`
|
||||
ForkInfo *ForkInfo `xorm:"-"`
|
||||
|
||||
Created time.Time `xorm:"CREATED"`
|
||||
Updated time.Time `xorm:"UPDATED"`
|
||||
@@ -167,6 +168,15 @@ type Repository struct {
|
||||
|
||||
func (repo *Repository) AfterSet(colName string, _ xorm.Cell) {
|
||||
switch colName {
|
||||
case "is_fork":
|
||||
forkInfo := new(ForkInfo)
|
||||
has, err := x.Where("repo_id=?", repo.ID).Get(forkInfo)
|
||||
if err != nil {
|
||||
log.Error(3, "get fork in[%d]: %v", repo.ID, err)
|
||||
return
|
||||
} else if has {
|
||||
repo.ForkInfo = forkInfo
|
||||
}
|
||||
case "updated":
|
||||
repo.Updated = regulateTimeZone(repo.Updated)
|
||||
}
|
||||
@@ -883,6 +893,16 @@ func ChangeRepositoryName(u *User, oldRepoName, newRepoName string) (err error)
|
||||
return os.Rename(RepoPath(u.LowerName, oldRepoName), RepoPath(u.LowerName, newRepoName))
|
||||
}
|
||||
|
||||
func getRepositoriesByForkID(e Engine, forkID int64) ([]*Repository, error) {
|
||||
repos := make([]*Repository, 0, 10)
|
||||
return repos, e.Where("fork_id=?", forkID).Find(&repos)
|
||||
}
|
||||
|
||||
// GetRepositoriesByForkID returns all repositories with given fork ID.
|
||||
func GetRepositoriesByForkID(forkID int64) ([]*Repository, error) {
|
||||
return getRepositoriesByForkID(x, forkID)
|
||||
}
|
||||
|
||||
func updateRepository(e Engine, repo *Repository, visibilityChanged bool) (err error) {
|
||||
repo.LowerName = strings.ToLower(repo.Name)
|
||||
|
||||
@@ -909,6 +929,17 @@ func updateRepository(e Engine, repo *Repository, visibilityChanged bool) (err e
|
||||
if err = repo.recalculateTeamAccesses(e, 0); err != nil {
|
||||
return fmt.Errorf("recalculateTeamAccesses: %v", err)
|
||||
}
|
||||
|
||||
forkRepos, err := getRepositoriesByForkID(e, repo.ID)
|
||||
if err != nil {
|
||||
return fmt.Errorf("getRepositoriesByForkID: %v", err)
|
||||
}
|
||||
for i := range forkRepos {
|
||||
forkRepos[i].IsPrivate = repo.IsPrivate
|
||||
if err = updateRepository(e, forkRepos[i], true); err != nil {
|
||||
return fmt.Errorf("updateRepository[%d]: %v", forkRepos[i].ID, err)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return nil
|
||||
@@ -929,7 +960,7 @@ func UpdateRepository(repo *Repository, visibilityChanged bool) (err error) {
|
||||
}
|
||||
|
||||
// DeleteRepository deletes a repository for a user or organization.
|
||||
func DeleteRepository(uid, repoID int64, userName string) error {
|
||||
func DeleteRepository(uid, repoID int64) error {
|
||||
repo := &Repository{ID: repoID, OwnerID: uid}
|
||||
has, err := x.Get(repo)
|
||||
if err != nil {
|
||||
@@ -1015,7 +1046,9 @@ func DeleteRepository(uid, repoID int64, userName string) error {
|
||||
|
||||
if repo.IsFork {
|
||||
if _, err = sess.Exec("UPDATE `repository` SET num_forks=num_forks-1 WHERE id=?", repo.ForkID); err != nil {
|
||||
return err
|
||||
return fmt.Errorf("decrease fork count: %v", err)
|
||||
} else if _, err = sess.Delete(&ForkInfo{RepoID: repo.ID}); err != nil {
|
||||
return fmt.Errorf("delete fork info: %v", err)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1024,8 +1057,12 @@ func DeleteRepository(uid, repoID int64, userName string) error {
|
||||
}
|
||||
|
||||
// Remove repository files.
|
||||
if err = os.RemoveAll(RepoPath(userName, repo.Name)); err != nil {
|
||||
desc := fmt.Sprintf("delete repository files(%s/%s): %v", userName, repo.Name, err)
|
||||
repoPath, err := repo.RepoPath()
|
||||
if err != nil {
|
||||
return fmt.Errorf("RepoPath: %v", err)
|
||||
}
|
||||
if err = os.RemoveAll(repoPath); err != nil {
|
||||
desc := fmt.Sprintf("delete repository files[%s]: %v", repoPath, err)
|
||||
log.Warn(desc)
|
||||
if err = CreateRepositoryNotice(desc); err != nil {
|
||||
log.Error(4, "add notice: %v", err)
|
||||
@@ -1039,7 +1076,32 @@ func DeleteRepository(uid, repoID int64, userName string) error {
|
||||
}
|
||||
}
|
||||
|
||||
return sess.Commit()
|
||||
if err = sess.Commit(); err != nil {
|
||||
return fmt.Errorf("Commit: %v", err)
|
||||
}
|
||||
|
||||
if repo.NumForks > 0 {
|
||||
if repo.IsPrivate {
|
||||
forkRepos, err := GetRepositoriesByForkID(repo.ID)
|
||||
if err != nil {
|
||||
return fmt.Errorf("getRepositoriesByForkID: %v", err)
|
||||
}
|
||||
for i := range forkRepos {
|
||||
if err = DeleteRepository(forkRepos[i].OwnerID, forkRepos[i].ID); err != nil {
|
||||
log.Error(4, "updateRepository[%d]: %v", forkRepos[i].ID, err)
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if _, err = x.Exec("UPDATE `repository` SET fork_id=0,is_fork=? WHERE fork_id=?", false, repo.ID); err != nil {
|
||||
log.Error(4, "reset 'fork_id' and 'is_fork': %v", err)
|
||||
}
|
||||
if _, err = x.Delete(&ForkInfo{ForkID: repo.ID}); err != nil {
|
||||
log.Error(4, "clear fork infos: %v", err)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// GetRepositoryByRef returns a Repository specified by a GFM reference.
|
||||
@@ -1275,6 +1337,27 @@ func GitGcRepos() error {
|
||||
})
|
||||
}
|
||||
|
||||
type repoChecker struct {
|
||||
querySQL, correctSQL string
|
||||
desc string
|
||||
}
|
||||
|
||||
func repoStatsCheck(checker *repoChecker) {
|
||||
results, err := x.Query(checker.querySQL)
|
||||
if err != nil {
|
||||
log.Error(4, "Select %s: %v", checker.desc, err)
|
||||
return
|
||||
}
|
||||
for _, result := range results {
|
||||
id := com.StrTo(result["id"]).MustInt64()
|
||||
log.Trace("Updating %s: %d", checker.desc, id)
|
||||
_, err = x.Exec(checker.correctSQL, id, id)
|
||||
if err != nil {
|
||||
log.Error(4, "Update %s[%d]: %v", checker.desc, id, err)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func CheckRepoStats() {
|
||||
if isCheckingRepos {
|
||||
return
|
||||
@@ -1284,69 +1367,66 @@ func CheckRepoStats() {
|
||||
|
||||
log.Trace("Doing: CheckRepoStats")
|
||||
|
||||
// ***** START: Repository.NumWatches *****
|
||||
results, err := x.Query("SELECT repo.id FROM `repository` repo WHERE repo.num_watches!=(SELECT COUNT(*) FROM `watch` WHERE repo_id=repo.id)")
|
||||
if err != nil {
|
||||
log.Error(4, "Select repository check 'watch': %v", err)
|
||||
return
|
||||
checkers := []*repoChecker{
|
||||
// Repository.NumWatches
|
||||
{
|
||||
"SELECT repo.id FROM `repository` repo WHERE repo.num_watches!=(SELECT COUNT(*) FROM `watch` WHERE repo_id=repo.id)",
|
||||
"UPDATE `repository` SET num_watches=(SELECT COUNT(*) FROM `watch` WHERE repo_id=?) WHERE id=?",
|
||||
"repository count 'num_watches'",
|
||||
},
|
||||
// Repository.NumStars
|
||||
{
|
||||
"SELECT repo.id FROM `repository` repo WHERE repo.num_stars!=(SELECT COUNT(*) FROM `star` WHERE repo_id=repo.id)",
|
||||
"UPDATE `repository` SET num_stars=(SELECT COUNT(*) FROM `star` WHERE repo_id=?) WHERE id=?",
|
||||
"repository count 'num_stars'",
|
||||
},
|
||||
// Label.NumIssues
|
||||
{
|
||||
"SELECT label.id FROM `label` WHERE label.num_issues!=(SELECT COUNT(*) FROM `issue_label` WHERE label_id=label.id)",
|
||||
"UPDATE `label` SET num_issues=(SELECT COUNT(*) FROM `issue_label` WHERE label_id=?) WHERE id=?",
|
||||
"label count 'num_issues'",
|
||||
},
|
||||
// User.NumRepos
|
||||
{
|
||||
"SELECT `user`.id FROM `user` WHERE `user`.num_repos!=(SELECT COUNT(*) FROM `repository` WHERE owner_id=`user`.id)",
|
||||
"UPDATE `user` SET num_repos=(SELECT COUNT(*) FROM `repository` WHERE owner_id=?) WHERE id=?",
|
||||
"user count 'num_repos'",
|
||||
},
|
||||
}
|
||||
for _, watch := range results {
|
||||
repoID := com.StrTo(watch["id"]).MustInt64()
|
||||
log.Trace("Updating repository count 'watch': %d", repoID)
|
||||
_, err = x.Exec("UPDATE `repository` SET num_watches=(SELECT COUNT(*) FROM `watch` WHERE repo_id=?) WHERE id=?", repoID, repoID)
|
||||
if err != nil {
|
||||
log.Error(4, "Update repository check 'watch'[%d]: %v", repoID, err)
|
||||
}
|
||||
for i := range checkers {
|
||||
repoStatsCheck(checkers[i])
|
||||
}
|
||||
// ***** END: Repository.NumWatches *****
|
||||
|
||||
// ***** START: Repository.NumStars *****
|
||||
results, err = x.Query("SELECT repo.id FROM `repository` repo WHERE repo.num_stars!=(SELECT COUNT(*) FROM `star` WHERE repo_id=repo.id)")
|
||||
// FIXME: use checker when v0.8, stop supporting old fork repo format.
|
||||
// ***** START: Repository.NumForks *****
|
||||
results, err := x.Query("SELECT repo.id FROM `repository` repo WHERE repo.num_forks!=(SELECT COUNT(*) FROM `repository` WHERE fork_id=repo.id)")
|
||||
if err != nil {
|
||||
log.Error(4, "Select repository check 'star': %v", err)
|
||||
return
|
||||
}
|
||||
for _, star := range results {
|
||||
repoID := com.StrTo(star["id"]).MustInt64()
|
||||
log.Trace("Updating repository count 'star': %d", repoID)
|
||||
_, err = x.Exec("UPDATE `repository` SET num_stars=(SELECT COUNT(*) FROM `star` WHERE repo_id=?) WHERE id=?", repoID, repoID)
|
||||
if err != nil {
|
||||
log.Error(4, "Update repository check 'star'[%d]: %v", repoID, err)
|
||||
}
|
||||
}
|
||||
// ***** END: Repository.NumStars *****
|
||||
log.Error(4, "Select repository count 'num_forks': %v", err)
|
||||
} else {
|
||||
for _, result := range results {
|
||||
id := com.StrTo(result["id"]).MustInt64()
|
||||
log.Trace("Updating repository count 'num_forks': %d", id)
|
||||
|
||||
// ***** START: Label.NumIssues *****
|
||||
results, err = x.Query("SELECT label.id FROM `label` WHERE label.num_issues!=(SELECT COUNT(*) FROM `issue_label` WHERE label_id=label.id)")
|
||||
if err != nil {
|
||||
log.Error(4, "Select label check 'num_issues': %v", err)
|
||||
return
|
||||
}
|
||||
for _, label := range results {
|
||||
labelID := com.StrTo(label["id"]).MustInt64()
|
||||
log.Trace("Updating label count 'num_issues': %d", labelID)
|
||||
_, err = x.Exec("UPDATE `label` SET num_issues=(SELECT COUNT(*) FROM `issue_label` WHERE label_id=?) WHERE id=?", labelID, labelID)
|
||||
if err != nil {
|
||||
log.Error(4, "Update label check 'num_issues'[%d]: %v", labelID, err)
|
||||
}
|
||||
}
|
||||
// ***** END: Label.NumIssues *****
|
||||
repo, err := GetRepositoryByID(id)
|
||||
if err != nil {
|
||||
log.Error(4, "GetRepositoryByID[%d]: %v", id, err)
|
||||
continue
|
||||
}
|
||||
|
||||
// ***** START: User.NumRepos *****
|
||||
results, err = x.Query("SELECT `user`.id FROM `user` WHERE `user`.num_repos!=(SELECT COUNT(*) FROM `repository` WHERE owner_id=`user`.id)")
|
||||
if err != nil {
|
||||
log.Error(4, "Select user check 'num_repos': %v", err)
|
||||
return
|
||||
}
|
||||
for _, user := range results {
|
||||
userID := com.StrTo(user["id"]).MustInt64()
|
||||
log.Trace("Updating user count 'num_repos': %d", userID)
|
||||
_, err = x.Exec("UPDATE `user` SET num_repos=(SELECT COUNT(*) FROM `repository` WHERE owner_id=?) WHERE id=?", userID, userID)
|
||||
if err != nil {
|
||||
log.Error(4, "Update user check 'num_repos'[%d]: %v", userID, err)
|
||||
rawResult, err := x.Query("SELECT COUNT(*) FROM `repository` WHERE fork_id=?", repo.ID)
|
||||
if err != nil {
|
||||
log.Error(4, "Select count of forks[%d]: %v", repo.ID, err)
|
||||
continue
|
||||
}
|
||||
repo.NumForks = int(parseCountResult(rawResult))
|
||||
|
||||
if err = UpdateRepository(repo, false); err != nil {
|
||||
log.Error(4, "UpdateRepository[%d]: %v", id, err)
|
||||
continue
|
||||
}
|
||||
}
|
||||
}
|
||||
// ***** END: User.NumRepos *****
|
||||
// ***** END: Repository.NumForks *****
|
||||
}
|
||||
|
||||
// _________ .__ .__ ___. __ .__
|
||||
@@ -1589,6 +1669,13 @@ func IsStaring(uid, repoId int64) bool {
|
||||
// \___ / \____/|__| |__|_ \
|
||||
// \/ \/
|
||||
|
||||
type ForkInfo struct {
|
||||
ID int64 `xorm:"pk autoincr"`
|
||||
ForkID int64
|
||||
RepoID int64 `xorm:"UNIQUE"`
|
||||
StartCommitID string `xorm:"VARCHAR(40)"`
|
||||
}
|
||||
|
||||
// HasForkedRepo checks if given user has already forked a repository with given ID.
|
||||
func HasForkedRepo(ownerID, repoID int64) (*Repository, bool) {
|
||||
repo := new(Repository)
|
||||
@@ -1598,14 +1685,15 @@ func HasForkedRepo(ownerID, repoID int64) (*Repository, bool) {
|
||||
|
||||
func ForkRepository(u *User, oldRepo *Repository, name, desc string) (_ *Repository, err error) {
|
||||
repo := &Repository{
|
||||
OwnerID: u.Id,
|
||||
Owner: u,
|
||||
Name: name,
|
||||
LowerName: strings.ToLower(name),
|
||||
Description: desc,
|
||||
IsPrivate: oldRepo.IsPrivate,
|
||||
IsFork: true,
|
||||
ForkID: oldRepo.ID,
|
||||
OwnerID: u.Id,
|
||||
Owner: u,
|
||||
Name: name,
|
||||
LowerName: strings.ToLower(name),
|
||||
Description: desc,
|
||||
DefaultBranch: oldRepo.DefaultBranch,
|
||||
IsPrivate: oldRepo.IsPrivate,
|
||||
IsFork: true,
|
||||
ForkID: oldRepo.ID,
|
||||
}
|
||||
|
||||
sess := x.NewSession()
|
||||
@@ -1621,6 +1709,13 @@ func ForkRepository(u *User, oldRepo *Repository, name, desc string) (_ *Reposit
|
||||
if _, err = sess.Exec("UPDATE `repository` SET num_forks=num_forks+1 WHERE id=?", oldRepo.ID); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
// else if _, err = sess.Insert(&ForkInfo{
|
||||
// ForkID: oldRepo.ID,
|
||||
// RepoID: repo.ID,
|
||||
// StartCommitID: "",
|
||||
// }); err != nil {
|
||||
// return nil, fmt.Errorf("insert fork info: %v", err)
|
||||
// }
|
||||
|
||||
oldRepoPath, err := oldRepo.RepoPath()
|
||||
if err != nil {
|
||||
|
||||
@@ -299,7 +299,7 @@ func confAppIni() (*asset, error) {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
info := bindataFileInfo{name: "conf/app.ini", size: 9732, mode: os.FileMode(420), modTime: time.Unix(1441110408, 0)}
|
||||
info := bindataFileInfo{name: "conf/app.ini", size: 9732, mode: os.FileMode(420), modTime: time.Unix(1441114387, 0)}
|
||||
a := &asset{bytes: bytes, info: info}
|
||||
return a, nil
|
||||
}
|
||||
@@ -4364,7 +4364,7 @@ func confLocaleLocale_deDeIni() (*asset, error) {
|
||||
return a, nil
|
||||
}
|
||||
|
||||
var _confLocaleLocale_enUsIni = []byte("\x1f\x8b\x08\x00\x00\x09\x6e\x88\x00\xff\xc4\x7d\xfd\x72\xdc\x48\x8e\xe7\xff\x7c\x0a\xb6\x37\x7c\xee\x8e\x90\xcb\xd1\xdd\x71\x1f\xd1\x61\xbb\x4f\x96\xda\x1f\xb3\x96\xa5\xb5\xe4\x99\x9b\x73\x38\xd8\xac\x22\x55\xc5\x71\x15\x59\x4d\xb2\x5c\xae\xd9\xd8\x88\x7b\x8d\x7b\xbd\x7b\x92\x03\x7e\x00\xf2\x83\x64\xc9\xf6\xec\xc6\xdd\x3f\x12\x2b\x13\xf9\x85\x44\x22\x01\x24\x12\x99\x6f\xb7\x59\x51\x76\x8b\xf4\x49\x7a\x9a\x6e\xf3\xaa\x5e\x97\x5d\x97\x76\xe5\xfa\xf6\xe1\xaa\xe9\xfa\xb2\x48\x5f\x54\x3d\xfd\x6e\x3f\x55\x8b\x32\x49\x56\xcd\xa6\x24\xd0\x97\xf4\x2f\x29\xf2\x6e\x35\x6f\xf2\xb6\xa0\x84\x73\xfb\x4e\xca\xcf\xdb\x75\xd3\x32\xd0\x6f\xf2\x95\xac\xca\xf5\x96\xcb\xd0\xbf\xa4\xab\x96\x75\x56\xd5\xf4\xf3\x9a\xbe\xd2\x57\x75\xd2\x35\x8b\x2a\x5f\x67\x41\x06\x12\x2c\xff\x97\xf4\xa7\xba\x48\xaf\xfb\x72\x9b\x3e\xee\x36\xf9\x7a\xfd\x34\xef\x50\xa4\x2f\xd3\x7c\xb1\x68\x76\x75\xff\xf8\x91\x64\x48\xe5\xcd\xae\xb7\xda\x2f\x77\xbd\xa4\xed\xb6\x96\xf4\x6e\x9b\xb4\xe5\xb2\xa2\x81\xb5\x94\xf4\x56\x3f\x93\x7d\x39\xef\xaa\x9e\x3b\xfd\x17\xf9\x4a\x3e\x95\x6d\x57\x35\xdc\x9f\x3f\xcb\x57\xb2\xcd\x97\x0c\x70\x45\xff\x92\xbe\xdc\x6c\xd7\x39\x0a\xdc\xe8\x67\xb2\xce\xeb\xe5\x4e\x60\x5e\xeb\x67\xb2\x68\x4b\xca\xca\xea\x72\x4f\xa9\x67\xf8\x91\xd2\x8f\xd9\x6c\x96\xec\x08\xa7\xd9\xb6\x6d\x6e\xab\x75\x99\xe5\x75\x91\x6d\x04\x6b\xef\x28\x3d\xd5\xf4\x94\xd2\x53\x4e\xc7\x30\xca\x82\x10\x94\xe5\x9d\x8e\x85\xa6\x86\xf0\x95\x77\x09\xaa\xaa\xf3\x8d\x95\xe6\xcf\xa4\xdc\xe4\xd5\x9a\x27\xe1\x21\x7f\x50\xe7\xbb\x6e\xdf\x60\xaa\xae\xf4\x93\x10\x91\xf5\x87\x6d\x09\x3c\x3c\xbc\xa1\xaf\x64\x91\x6f\xfb\xc5\x2a\xe7\xbe\xca\x57\x42\x40\xdb\x86\x10\xd2\xb4\x07\xc0\xd9\x8f\xa4\x69\x97\x79\x5d\xfd\x3d\xef\x05\x49\x97\xc1\xcf\x64\x53\xb5\x6d\xc3\xf8\xbd\xc0\x47\x42\x23\xce\xb8\x1e\x4a\x79\x43\x98\x08\x6a\xe1\x9c\x4d\xb5\x6c\x05\x95\x9c\x79\x81\x5f\x5c\x0b\xe7\xdd\x36\xed\x47\xcd\x78\xce\x9f\x83\xa2\xd4\x09\xcd\x8d\xdb\xcf\x6b\x42\xbe\xe6\x5e\xe0\x47\x04\xd0\x25\x79\xb1\x21\x54\x6e\xf3\xba\x64\x1c\x9d\xf2\x2f\xc2\x0b\xfd\x4a\x94\xa6\xb2\xae\xec\xfb\xaa\x5e\x32\xb2\x4f\x25\x29\xbd\xd6\xa4\x24\xc8\x73\x69\x87\x66\xe7\xa6\x93\xd2\xff\x4a\x3f\xd3\x2b\xf9\x29\x79\x41\x21\x64\xba\x92\x3c\x92\x2e\xbb\x2d\xcb\x42\xc6\xd2\xa5\xcf\xe9\x3b\xd9\xee\xd6\x6b\xc2\xda\x1f\xbb\xb2\xeb\xb9\xd0\x15\xfd\xa6\xf1\xcb\xef\xa4\xea\x3a\xfa\xa0\xe4\x57\xf8\x48\x68\xea\xea\x05\x06\x73\x86\x8f\x24\x79\xdf\x95\x79\xbb\x58\x7d\x48\xe4\x3f\xfa\xca\x1f\x4c\x7b\xc7\x26\x95\x09\x49\x89\x48\x5a\xb0\x06\x92\x45\x53\xf0\x8f\x33\xfa\x47\x55\x57\x75\xd7\xd3\x8a\xfb\x90\xe8\x07\x83\xc9\x97\x4c\x40\x5f\xf5\xc0\x82\x26\x62\xf9\x76\x3c\x83\xe9\xf3\xaa\xed\xfa\x87\x7d\x45\xc4\xfa\x76\x57\x27\x3c\x3e\x5a\x6d\x59\x31\x37\x26\xf4\xa2\x21\x14\x21\xb9\xa5\xf1\x5d\x1c\xae\xff\xe5\xf5\x49\x7a\x45\x9c\x68\xd9\x96\xf4\x9d\x52\x1d\xf4\x8f\xca\xfc\x3c\x4b\xa8\x94\xb5\x74\x9e\xf7\xf9\x3c\xef\x4a\x8f\x56\xce\x14\xea\x76\x79\xa0\x71\xe6\x6a\xe0\x60\x5d\x1f\x8d\x77\x6a\x85\x50\x1d\xba\xae\x5c\x1d\x6f\x78\x71\x51\x3a\x33\x35\x14\xbe\x5a\x97\x9c\x4e\x55\xa5\xaf\xde\xbc\xb9\x3c\x7f\x96\x96\xf5\xb2\xaa\xcb\x74\x5f\xf5\xab\x74\xd7\xdf\xfe\xb7\x6c\x59\xd6\x65\x4b\x3c\x6e\x51\xa5\xb4\xa6\x5a\xa2\x84\x94\x08\x5b\x06\x37\x4b\xba\x6e\x4d\x6b\x1f\xe8\xbd\xbe\x7e\x9d\x5e\x30\x8a\xb7\x79\xbf\x42\x47\xfa\x55\xd2\xfd\xb1\x66\x14\xb9\x06\x6f\x56\x65\x0a\x2a\x03\x50\x73\x6b\xf8\x48\x0b\xed\xe3\x2c\x29\xdb\x36\x23\xb6\xd4\x1f\x32\x2d\xac\xf5\x0d\x21\xa5\x0a\x22\x9d\xba\xe9\xd3\x79\x99\xa2\xcc\x2c\x49\xac\xc3\x86\xdd\xd3\xed\x76\x5d\x2d\x64\xad\xbf\x90\x3c\x8f\x68\xde\x41\x14\x4b\x21\x1c\x10\x65\x79\x01\xba\x88\x3d\xf3\x7a\x48\x23\x06\x82\xf2\xab\x92\x18\xe0\x6a\xb7\x14\xb6\xb7\x6e\x76\xc5\x77\xa0\x54\xeb\xbd\x27\xd4\xf4\x6d\x43\x1d\x06\x76\x1c\x80\x6f\xe2\x94\x28\x8e\x37\xad\xb6\xdc\x34\xc4\x57\x1c\xb1\x57\x44\x50\xfb\x8a\x32\x69\xa4\x5d\xfe\x89\xd6\x5b\xdf\xa4\xfd\xaa\xea\xd2\x82\x88\x6d\xc1\x15\xd3\xd2\xd8\xd1\x76\x21\x64\x41\x04\x2a\xa4\x61\x69\xf1\x1c\x00\x6a\xb3\x23\x6a\x5a\x51\x65\xbc\x19\xf1\xce\x49\x55\x4e\xf5\x13\x43\xa2\x7a\x40\xdf\x44\xb9\x0d\x71\x65\xe6\x9b\xe7\xf8\xd0\xdf\x61\xfd\xd4\xab\xfc\xf6\x96\x7a\xd5\x11\x55\xbc\x4c\x17\xeb\x86\x48\xea\xdd\xdb\xd7\x1d\x13\xcc\x2a\xdb\x36\x2d\xb6\x39\xca\xba\xa2\x4f\x97\x16\x20\x9a\x21\xea\xdd\x66\x4e\xbf\xf6\xab\x8a\x38\x00\xd0\xce\x25\x78\x37\xa7\x54\x6a\x62\xd7\xd1\x14\x9e\xa4\x44\xc2\x34\x02\x42\x19\x08\x80\xc7\x50\x54\x5d\x3e\xa7\xb9\x67\xf0\x5b\xda\xb6\x76\x2d\x91\xd5\xaa\xef\xb7\xd6\xf2\xcb\x9b\x9b\x2b\x69\xda\xa5\xde\xd5\x76\x1e\x50\x06\xe6\x60\xcd\x1b\x6f\x9d\x36\xf5\x0c\x44\xb2\x6b\xd7\x03\xfa\xa1\xb1\x5a\xce\x11\xbc\x70\x17\x1e\xf1\x9f\x6b\x8f\x1e\xe0\xb9\x23\xe9\x64\x0f\x6a\x22\x1c\x97\xd8\x00\x89\xa8\x9b\x2d\xd7\x1b\x50\xf5\xa5\x26\x78\x52\xc6\xa6\xe9\xf2\x65\xeb\xa4\x5c\xc8\x3e\x01\xfb\xdf\xd0\x80\x95\x8d\x5c\x5f\x10\x1a\xc0\x4b\x90\x7a\xdb\x36\x1b\x4a\x7d\x4e\xff\x7c\x82\xef\xfe\x05\xd7\x07\x98\xbc\x28\x88\xbf\x75\x27\xe9\xdb\xe7\x67\xe9\x7f\xfe\xf9\xa7\x9f\x66\xe9\xab\x9e\x57\x22\x13\xe7\xdf\x98\xa8\xe8\x53\xf6\x70\x07\x4a\x2c\xa3\x27\xba\xbLine truncated
|
||||
var _confLocaleLocale_enUsIni = []byte("\x1f\x8b\x08\x00\x00\x09\x6e\x88\x00\xff\xc4\x7d\xfd\x72\xdc\x48\x8e\xe7\xff\x7c\x0a\xb6\x37\x7c\xee\x8e\x90\xcb\xd1\xdd\x71\x1f\xd1\x61\xbb\x4f\x96\xda\x1f\xb3\x96\xa5\xb5\xe4\x99\x9b\x73\x38\xd8\xac\x22\xab\x8a\xe3\x2a\xb2\x9a\x64\xb9\xac\xd9\xd8\x88\x7b\x8d\x7b\xbd\x7b\x92\x03\x7e\x00\xf2\x83\x64\xc9\xf6\xec\xc6\xdd\x3f\x12\x2b\x13\xf9\x85\x44\x22\x01\x24\x12\x99\xef\x76\x59\x51\x76\x8b\xf4\x49\x7a\x9a\xee\xf2\xaa\xde\x94\x5d\x97\x76\xe5\x66\xf9\x70\xdd\x74\x7d\x59\xa4\x2f\xaa\x9e\x7e\xb7\x9f\xaa\x45\x99\x24\xeb\x66\x5b\x12\xe8\x4b\xfa\x97\x14\x79\xb7\x9e\x37\x79\x5b\x50\xc2\xb9\x7d\x27\xe5\xe7\xdd\xa6\x69\x19\xe8\x37\xf9\x4a\xd6\xe5\x66\xc7\x65\xe8\x5f\xd2\x55\xab\x3a\xab\x6a\xfa\x79\x4d\x5f\xe9\xab\x3a\xe9\x9a\x45\x95\x6f\xb2\x20\x03\x09\x96\xff\x4b\xfa\x53\x5d\xa4\xd7\x7d\xb9\x4b\x1f\x77\xdb\x7c\xb3\x79\x9a\x77\x28\xd2\x97\x69\xbe\x58\x34\xfb\xba\x7f\xfc\x48\x32\xa4\xf2\x66\xdf\x5b\xed\x97\xfb\x5e\xd2\xf6\x3b\x4b\x7a\xb7\x4b\xda\x72\x55\xd1\xc0\x5a\x4a\x7a\xab\x9f\xc9\xa1\x9c\x77\x55\xcf\x9d\xfe\x8b\x7c\x25\x9f\xca\xb6\xab\x1a\xee\xcf\x9f\xe5\x2b\xd9\xe5\x2b\x06\xb8\xa2\x7f\x49\x5f\x6e\x77\x9b\x1c\x05\x6e\xf4\x33\xd9\xe4\xf5\x6a\x2f\x30\xaf\xf5\x33\x59\xb4\x25\x65\x65\x75\x79\xa0\xd4\x33\xfc\x48\xe9\xc7\x6c\x36\x4b\xf6\x84\xd3\x6c\xd7\x36\xcb\x6a\x53\x66\x79\x5d\x64\x5b\xc1\xda\x3b\x4a\x4f\x35\x3d\xa5\xf4\x94\xd3\x31\x8c\xb2\x20\x04\x65\x79\xa7\x63\xa1\xa9\x21\x7c\xe5\x5d\x82\xaa\xea\x7c\x6b\xa5\xf9\x33\x29\xb7\x79\xb5\xe1\x49\x78\xc8\x1f\xd4\xf9\xae\x3b\x34\x98\xaa\x2b\xfd\x24\x44\x64\xfd\xed\xae\x04\x1e\x1e\xde\xd0\x57\xb2\xc8\x77\xfd\x62\x9d\x73\x5f\xe5\x2b\x21\xa0\x5d\x43\x08\x69\xda\x5b\xc0\xd9\x8f\xa4\x69\x57\x79\x5d\xfd\x3d\xef\x05\x49\x97\xc1\xcf\x64\x5b\xb5\x6d\xc3\xf8\xbd\xc0\x47\x42\x23\xce\xb8\x1e\x4a\x79\x43\x98\x08\x6a\xe1\x9c\x6d\xb5\x6a\x05\x95\x9c\x79\x81\x5f\x5c\x0b\xe7\x2d\x9b\xf6\xa3\x66\x3c\xe7\xcf\x41\x51\xea\x84\xe6\xc6\xed\xe7\x35\x21\x5f\x73\x2f\xf0\x23\x02\xe8\x92\xbc\xd8\x12\x2a\x77\x79\x5d\x32\x8e\x4e\xf9\x17\xe1\x85\x7e\x25\x4a\x53\x59\x57\xf6\x7d\x55\xaf\x18\xd9\xa7\x92\x94\x5e\x6b\x52\x12\xe4\xb9\xb4\xdb\x66\xef\xa6\x93\xd2\xff\x4a\x3f\xd3\x2b\xf9\x29\x79\x41\x21\x64\xba\x92\x3c\x92\x2e\x5b\x96\x65\x21\x63\xe9\xd2\xe7\xf4\x9d\xec\xf6\x9b\x0d\x61\xed\x8f\x7d\xd9\xf5\x5c\xe8\x8a\x7e\xd3\xf8\xe5\x77\x52\x75\x1d\x7d\x50\xf2\x2b\x7c\x24\x34\x75\xf5\x02\x83\x39\xc3\x47\x92\xbc\xef\xca\xbc\x5d\xac\x3f\x24\xf2\x1f\x7d\xe5\x0f\xa6\xbd\x63\x93\xca\x84\xa4\x44\x24\x2d\x58\x03\xc9\xa2\x29\xf8\xc7\x19\xfd\xa3\xaa\xab\xba\xeb\x69\xc5\x7d\x48\xf4\x83\xc1\xe4\x4b\x26\xa0\xaf\x7a\x60\x41\x13\xb1\x7c\x3b\x9e\xc1\xf4\x79\xd5\x76\xfd\xc3\xbe\x22\x62\x7d\xbb\xaf\x13\x1e\x1f\xad\xb6\xac\x98\x1b\x13\x7a\xd1\x10\x8a\x90\xdc\xd2\xf8\x2e\x6e\xaf\xff\xe5\xf5\x49\x7a\x45\x9c\x68\xd5\x96\xf4\x9d\x52\x1d\xf4\x8f\xca\xfc\x3c\x4b\xa8\x94\xb5\x74\x9e\xf7\xf9\x3c\xef\x4a\x8f\x56\xce\x14\xea\x76\x79\xa0\x71\xe6\x6a\xe0\x60\x5d\x1f\x8d\x77\x6a\x85\x50\x1d\xba\xae\x5c\x1d\x6f\x78\x71\x51\x3a\x33\x35\x14\xbe\xda\x94\x9c\x4e\x55\xa5\xaf\xde\xbc\xb9\x3c\x7f\x96\x96\xf5\xaa\xaa\xcb\xf4\x50\xf5\xeb\x74\xdf\x2f\xff\x5b\xb6\x2a\xeb\xb2\x25\x1e\xb7\xa8\x52\x5a\x53\x2d\x51\x42\x4a\x84\x2d\x83\x9b\x25\x5d\xb7\xa1\xb5\x0f\xf4\x5e\x5f\xbf\x4e\x2f\x18\xc5\xbb\xbc\x5f\xa3\x23\xfd\x3a\xe9\xfe\xd8\x30\x8a\x5c\x83\x37\xeb\x32\x05\x95\x01\xa8\x59\x1a\x3e\xd2\x42\xfb\x38\x4b\xca\xb6\xcd\x88\x2d\xf5\xb7\x99\x16\xd6\xfa\x86\x90\x52\x05\x91\x4e\xdd\xf4\xe9\xbc\x4c\x51\x66\x96\x24\xd6\x61\xc3\xee\xe9\x6e\xb7\xa9\x16\xb2\xd6\x5f\x48\x9e\x47\x34\xef\x20\x8a\xa5\x10\x0e\x88\xb2\xbc\x00\x5d\xc4\x9e\x79\x3d\xa4\x11\x03\x41\xf9\x75\x49\x0c\x70\xbd\x5f\x09\xdb\xdb\x34\xfb\xe2\x3b\x50\xaa\xf5\xde\x13\x6a\xfa\xb6\xa1\x0e\x03\x3b\x0e\xc0\x37\x71\x4a\x14\xc7\x9b\x56\x5b\x6e\x1b\xe2\x2b\x8e\xd8\x2b\x22\xa8\x43\x45\x99\x34\xd2\x2e\xff\x44\xeb\xad\x6f\xd2\x7e\x5d\x75\x69\x41\xc4\xb6\xe0\x8a\x69\x69\xec\x69\xbb\x10\xb2\x20\x02\x15\xd2\xb0\xb4\x78\x0e\x00\xb5\xdd\x13\x35\xad\xa9\x32\xde\x8c\x78\xe7\xa4\x2a\xa7\xfa\x89\x21\x51\x3d\xa0\x6f\xa2\xdc\x86\xb8\x32\xf3\xcd\x73\x7c\xe8\xef\xb0\x7e\xea\x55\xbe\x5c\x52\xaf\x3a\xa2\x8a\x97\xe9\x62\xd3\x10\x49\xbd\x7b\xfb\xba\x63\x82\x59\x67\xbb\xa6\xc5\x36\x47\x59\x57\xf4\xe9\xd2\x02\x44\x33\x44\xbd\xdf\xce\xe9\xd7\x61\x5d\x11\x07\x00\xda\xb9\x04\xef\xe6\x94\x4a\x4d\xec\x3b\x9a\xc2\x93\x94\x48\x98\x46\x40\x28\x03\x01\xf0\x18\x8a\xaa\xcb\xe7\x34\xf7\x0c\xbe\xa4\x6d\x6b\xdf\x12\x59\xad\xfb\x7e\x67\x2d\xbf\xbc\xb9\xb9\x92\xa6\x5d\xea\x5d\x6d\xe7\x01\x65\x60\x0e\x36\xbc\xf1\xd6\x69\x53\xcf\x40\x24\xfb\x76\x33\xa0\x1f\x1a\xab\xe5\x1c\xc1\x0b\x77\xe1\x11\xff\xb9\xf6\xe8\x01\x9e\x3b\x92\x4e\x0e\xa0\x26\xc2\x71\x89\x0d\x90\x88\xba\xd9\x71\xbd\x01\x55\x5f\x6a\x82\x27\x65\x6c\x9a\x2e\x5f\xb6\x4e\xca\x85\xec\x13\xb0\xff\x2d\x0d\x58\xd9\xc8\xf5\x05\xa1\x01\xbc\x04\xa9\xcb\xb6\xd9\x52\xea\x73\xfa\xe7\x13\x7c\xf7\x2f\xb8\x3e\xc0\xe4\x45\x41\xfc\xad\x3b\x49\xdf\x3e\x3f\x4b\xff\xf3\xcf\x3f\xfd\x34\x4b\x5f\xf5\xbc\x12\x99\x38\xff\xc6\x44\x45\x9f\xb2\x87\x3b\x50\x62\x19\x3d\xd1\xdd\x3Line truncated
|
||||
|
||||
func confLocaleLocale_enUsIniBytes() ([]byte, error) {
|
||||
return bindataRead(
|
||||
@@ -4379,7 +4379,7 @@ func confLocaleLocale_enUsIni() (*asset, error) {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
info := bindataFileInfo{name: "conf/locale/locale_en-US.ini", size: 40472, mode: os.FileMode(420), modTime: time.Unix(1441114072, 0)}
|
||||
info := bindataFileInfo{name: "conf/locale/locale_en-US.ini", size: 40911, mode: os.FileMode(420), modTime: time.Unix(1441119631, 0)}
|
||||
a := &asset{bytes: bytes, info: info}
|
||||
return a, nil
|
||||
}
|
||||
|
||||
+37
-25
@@ -190,6 +190,41 @@ func RepoRef() macaron.Handler {
|
||||
}
|
||||
}
|
||||
|
||||
func RetrieveBaseRepo(ctx *Context, repo *models.Repository) {
|
||||
// Non-fork repository will not return error in this method.
|
||||
if err := repo.GetBaseRepo(); err != nil {
|
||||
if models.IsErrRepoNotExist(err) {
|
||||
repo.IsFork = false
|
||||
repo.ForkID = 0
|
||||
return
|
||||
}
|
||||
ctx.Handle(500, "GetBaseRepo", err)
|
||||
return
|
||||
} else if err = repo.BaseRepo.GetOwner(); err != nil {
|
||||
ctx.Handle(500, "BaseRepo.GetOwner", err)
|
||||
return
|
||||
}
|
||||
|
||||
bsaeRepo := repo.BaseRepo
|
||||
baseGitRepo, err := git.OpenRepository(models.RepoPath(bsaeRepo.Owner.Name, bsaeRepo.Name))
|
||||
if err != nil {
|
||||
ctx.Handle(500, "OpenRepository", err)
|
||||
return
|
||||
}
|
||||
if len(bsaeRepo.DefaultBranch) > 0 && baseGitRepo.IsBranchExist(bsaeRepo.DefaultBranch) {
|
||||
ctx.Data["BaseDefaultBranch"] = bsaeRepo.DefaultBranch
|
||||
} else {
|
||||
baseBranches, err := baseGitRepo.GetBranches()
|
||||
if err != nil {
|
||||
ctx.Handle(500, "GetBranches", err)
|
||||
return
|
||||
}
|
||||
if len(baseBranches) > 0 {
|
||||
ctx.Data["BaseDefaultBranch"] = baseBranches[0]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func RepoAssignment(redirect bool, args ...bool) macaron.Handler {
|
||||
return func(ctx *Context) {
|
||||
var (
|
||||
@@ -292,32 +327,9 @@ func RepoAssignment(redirect bool, args ...bool) macaron.Handler {
|
||||
ctx.Repo.Repository.NumTags = len(tags)
|
||||
|
||||
if repo.IsFork {
|
||||
// Non-fork repository will not return error in this method.
|
||||
if err = repo.GetBaseRepo(); err != nil {
|
||||
ctx.Handle(500, "GetBaseRepo", err)
|
||||
RetrieveBaseRepo(ctx, repo)
|
||||
if ctx.Written() {
|
||||
return
|
||||
} else if repo.BaseRepo.GetOwner(); err != nil {
|
||||
ctx.Handle(500, "BaseRepo.GetOwner", err)
|
||||
return
|
||||
}
|
||||
|
||||
bsaeRepo := repo.BaseRepo
|
||||
baseGitRepo, err := git.OpenRepository(models.RepoPath(bsaeRepo.Owner.Name, bsaeRepo.Name))
|
||||
if err != nil {
|
||||
ctx.Handle(500, "OpenRepository", err)
|
||||
return
|
||||
}
|
||||
if len(bsaeRepo.DefaultBranch) > 0 && baseGitRepo.IsBranchExist(bsaeRepo.DefaultBranch) {
|
||||
ctx.Data["BaseDefaultBranch"] = bsaeRepo.DefaultBranch
|
||||
} else {
|
||||
baseBranches, err := baseGitRepo.GetBranches()
|
||||
if err != nil {
|
||||
ctx.Handle(500, "GetBranches", err)
|
||||
return
|
||||
}
|
||||
if len(baseBranches) > 0 {
|
||||
ctx.Data["BaseDefaultBranch"] = baseBranches[0]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Vendored
+1
-1
@@ -1 +1 @@
|
||||
@font-face{font-family:octicons;src:url(../fonts/octicons.eot?#iefix&v=396334ee3da78f4302d25c758ae3e3ce5dc3c97d) format('embedded-opentype'),url(../fonts/octicons.woff?v=396334ee3da78f4302d25c758ae3e3ce5dc3c97d) format('woff'),url(../fonts/octicons.ttf?v=396334ee3da78f4302d25c758ae3e3ce5dc3c97d) format('truetype'),url(../fonts/octicons.svg?v=396334ee3da78f4302d25c758ae3e3ce5dc3c97d#octicons) format('svg');font-weight:400;font-style:normal}.mega-octicon,.octicon{font:normal normal normal 16px/1 octicons;display:inline-block;text-decoration:none;text-rendering:auto;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.mega-octicon{font-size:32px}.octicon-alert:before{content:'\f02d'}.octicon-arrow-down:before{content:'\f03f'}.octicon-arrow-left:before{content:'\f040'}.octicon-arrow-right:before{content:'\f03e'}.octicon-arrow-small-down:before{content:'\f0a0'}.octicon-arrow-small-left:before{content:'\f0a1'}.octicon-arrow-small-right:before{content:'\f071'}.octicon-arrow-small-up:before{content:'\f09f'}.octicon-arrow-up:before{content:'\f03d'}.octicon-beaker:before,.octicon-microscope:before{content:'\f0dd'}.octicon-bell:before{content:'\f0de'}.octicon-book:before{content:'\f007'}.octicon-bookmark:before{content:'\f07b'}.octicon-briefcase:before{content:'\f0d3'}.octicon-broadcast:before{content:'\f048'}.octicon-browser:before{content:'\f0c5'}.octicon-bug:before{content:'\f091'}.octicon-calendar:before{content:'\f068'}.octicon-check:before{content:'\f03a'}.octicon-checklist:before{content:'\f076'}.octicon-chevron-down:before{content:'\f0a3'}.octicon-chevron-left:before{content:'\f0a4'}.octicon-chevron-right:before{content:'\f078'}.octicon-chevron-up:before{content:'\f0a2'}.octicon-circle-slash:before{content:'\f084'}.octicon-circuit-board:before{content:'\f0d6'}.octicon-clippy:before{content:'\f035'}.octicon-clock:before{content:'\f046'}.octicon-cloud-download:before{content:'\f00b'}.octicon-cloud-upload:before{content:'\f00c'}.octicon-code:before{content:'\f05f'}.octicon-color-mode:before{content:'\f065'}.octicon-comment-add:before,.octicon-comment:before{content:'\f02b'}.octicon-comment-discussion:before{content:'\f04f'}.octicon-credit-card:before{content:'\f045'}.octicon-dash:before{content:'\f0ca'}.octicon-dashboard:before{content:'\f07d'}.octicon-database:before{content:'\f096'}.octicon-clone:before,.octicon-desktop-download:before{content:'\f0dc'}.octicon-device-camera:before{content:'\f056'}.octicon-device-camera-video:before{content:'\f057'}.octicon-device-desktop:before{content:'\f27c'}.octicon-device-mobile:before{content:'\f038'}.octicon-diff:before{content:'\f04d'}.octicon-diff-added:before{content:'\f06b'}.octicon-diff-ignored:before{content:'\f099'}.octicon-diff-modified:before{content:'\f06d'}.octicon-diff-removed:before{content:'\f06c'}.octicon-diff-renamed:before{content:'\f06e'}.octicon-ellipsis:before{content:'\f09a'}.octicon-eye-unwatch:before,.octicon-eye-watch:before,.octicon-eye:before{content:'\f04e'}.octicon-file-binary:before{content:'\f094'}.octicon-file-code:before{content:'\f010'}.octicon-file-directory:before{content:'\f016'}.octicon-file-media:before{content:'\f012'}.octicon-file-pdf:before{content:'\f014'}.octicon-file-submodule:before{content:'\f017'}.octicon-file-symlink-directory:before{content:'\f0b1'}.octicon-file-symlink-file:before{content:'\f0b0'}.octicon-file-text:before{content:'\f011'}.octicon-file-zip:before{content:'\f013'}.octicon-flame:before{content:'\f0d2'}.octicon-fold:before{content:'\f0cc'}.octicon-gear:before{content:'\f02f'}.octicon-gift:before{content:'\f042'}.octicon-gist:before{content:'\f00e'}.octicon-gist-secret:before{content:'\f08c'}.octicon-git-branch-create:before,.octicon-git-branch-delete:before,.octicon-git-branch:before{content:'\f020'}.octicon-git-commit:before{content:'\f01f'}.octicon-git-compare:before{content:'\f0ac'}.octicon-git-merge:before{content:'\f023'}.octicon-git-pull-request-abandoned:before,.octicon-git-pull-request:before{content:'\f009'}.octicon-globe:before{content:'\f0b6'}.octicon-graph:before{content:'\f043'}.octicon-heart:before{content:'\2665'}.octicon-history:before{content:'\f07e'}.octicon-home:before{content:'\f08d'}.octicon-horizontal-rule:before{content:'\f070'}.octicon-hubot:before{content:'\f09d'}.octicon-inbox:before{content:'\f0cf'}.octicon-info:before{content:'\f059'}.octicon-issue-closed:before{content:'\f028'}.octicon-issue-opened:before{content:'\f026'}.octicon-issue-reopened:before{content:'\f027'}.octicon-jersey:before{content:'\f019'}.octicon-key:before{content:'\f049'}.octicon-keyboard:before{content:'\f00d'}.octicon-law:before{content:'\f0d8'}.octicon-light-bulb:before{content:'\f000'}.octicon-link:before{content:'\f05c'}.octicon-link-external:before{content:'\f07f'}.octicon-list-ordered:before{content:'\f062'}.octicon-list-unordered:before{content:'\f061'}.octicon-location:before{content:'\f060'}.octicon-gLine truncated
|
||||
@font-face{font-family:octicons;src:url(../fonts/octicons.eot?#iefix&v=396334ee3da78f4302d25c758ae3e3ce5dc3c97d) format('embedded-opentype'),url(../fonts/octicons.woff?v=396334ee3da78f4302d25c758ae3e3ce5dc3c97d) format('woff'),url(../fonts/octicons.ttf?v=396334ee3da78f4302d25c758ae3e3ce5dc3c97d) format('truetype'),url(../fonts/octicons.svg?v=396334ee3da78f4302d25c758ae3e3ce5dc3c97d#octicons) format('svg');font-weight:400;font-style:normal}.mega-octicon,.octicon{font:normal normal normal 16px/1 octicons;display:inline-block;text-decoration:none;text-rendering:auto;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.mega-octicon{font-size:32px}.octicon-alert:before{content:'\f02d'}.octicon-arrow-down:before{content:'\f03f'}.octicon-arrow-left:before{content:'\f040'}.octicon-arrow-right:before{content:'\f03e'}.octicon-arrow-small-down:before{content:'\f0a0'}.octicon-arrow-small-left:before{content:'\f0a1'}.octicon-arrow-small-right:before{content:'\f071'}.octicon-arrow-small-up:before{content:'\f09f'}.octicon-arrow-up:before{content:'\f03d'}.octicon-beaker:before,.octicon-microscope:before{content:'\f0dd'}.octicon-bell:before{content:'\f0de'}.octicon-book:before{content:'\f007'}.octicon-bookmark:before{content:'\f07b'}.octicon-briefcase:before{content:'\f0d3'}.octicon-broadcast:before{content:'\f048'}.octicon-browser:before{content:'\f0c5'}.octicon-bug:before{content:'\f091'}.octicon-calendar:before{content:'\f068'}.octicon-check:before{content:'\f03a'}.octicon-checklist:before{content:'\f076'}.octicon-chevron-down:before{content:'\f0a3'}.octicon-chevron-left:before{content:'\f0a4'}.octicon-chevron-right:before{content:'\f078'}.octicon-chevron-up:before{content:'\f0a2'}.octicon-circle-slash:before{content:'\f084'}.octicon-circuit-board:before{content:'\f0d6'}.octicon-clippy:before{content:'\f035'}.octicon-clock:before{content:'\f046'}.octicon-cloud-download:before{content:'\f00b'}.octicon-cloud-upload:before{content:'\f00c'}.octicon-code:before{content:'\f05f'}.octicon-color-mode:before{content:'\f065'}.octicon-comment-add:before,.octicon-comment:before{content:'\f02b'}.octicon-comment-discussion:before{content:'\f04f'}.octicon-credit-card:before{content:'\f045'}.octicon-dash:before{content:'\f0ca'}.octicon-dashboard:before{content:'\f07d'}.octicon-database:before{content:'\f096'}.octicon-clone:before,.octicon-desktop-download:before{content:'\f0dc'}.octicon-device-camera:before{content:'\f056'}.octicon-device-camera-video:before{content:'\f057'}.octicon-device-desktop:before{content:'\f27c'}.octicon-device-mobile:before{content:'\f038'}.octicon-diff:before{content:'\f04d'}.octicon-diff-added:before{content:'\f06b'}.octicon-diff-ignored:before{content:'\f099'}.octicon-diff-modified:before{content:'\f06d'}.octicon-diff-removed:before{content:'\f06c'}.octicon-diff-renamed:before{content:'\f06e'}.octicon-ellipsis:before{content:'\f09a'}.octicon-eye-unwatch:before,.octicon-eye-watch:before,.octicon-eye:before{content:'\f04e'}.octicon-file-binary:before{content:'\f094'}.octicon-file-code:before{content:'\f010'}.octicon-file-directory:before{content:'\f016'}.octicon-file-media:before{content:'\f012'}.octicon-file-pdf:before{content:'\f014'}.octicon-file-submodule:before{content:'\f017'}.octicon-file-symlink-directory:before{content:'\f0b1'}.octicon-file-symlink-file:before{content:'\f0b0'}.octicon-file-text:before{content:'\f011'}.octicon-file-zip:before{content:'\f013'}.octicon-flame:before{content:'\f0d2'}.octicon-fold:before{content:'\f0cc'}.octicon-gear:before{content:'\f02f'}.octicon-gift:before{content:'\f042'}.octicon-gist:before{content:'\f00e'}.octicon-gist-secret:before{content:'\f08c'}.octicon-git-branch-create:before,.octicon-git-branch-delete:before,.octicon-git-branch:before{content:'\f020'}.octicon-git-commit:before{content:'\f01f'}.octicon-git-compare:before{content:'\f0ac'}.octicon-git-merge:before{content:'\f023'}.octicon-git-pull-request-abandoned:before,.octicon-git-pull-request:before{content:'\f009'}.octicon-globe:before{content:'\f0b6'}.octicon-graph:before{content:'\f043'}.octicon-heart:before{content:'\2665'}.octicon-history:before{content:'\f07e'}.octicon-home:before{content:'\f08d'}.octicon-horizontal-rule:before{content:'\f070'}.octicon-hubot:before{content:'\f09d'}.octicon-inbox:before{content:'\f0cf'}.octicon-info:before{content:'\f059'}.octicon-issue-closed:before{content:'\f028'}.octicon-issue-opened:before{content:'\f026'}.octicon-issue-reopened:before{content:'\f027'}.octicon-jersey:before{content:'\f019'}.octicon-key:before{content:'\f049'}.octicon-keyboard:before{content:'\f00d'}.octicon-law:before{content:'\f0d8'}.octicon-light-bulb:before{content:'\f000'}.octicon-link:before{content:'\f05c'}.octicon-link-external:before{content:'\f07f'}.octicon-list-ordered:before{content:'\f062'}.octicon-list-unordered:before{content:'\f061'}.octicon-location:before{content:'\f060'}.octicon-gLine truncated
|
||||
@@ -61,11 +61,13 @@
|
||||
}
|
||||
|
||||
&.new.repo {
|
||||
.selection.dropdown {
|
||||
width: 50%!important;
|
||||
}
|
||||
#auto-init {
|
||||
margin-left: @input-padding+15px;
|
||||
.ui.form {
|
||||
.selection.dropdown:not(.owner) {
|
||||
width: 50%!important;
|
||||
}
|
||||
#auto-init {
|
||||
margin-left: @input-padding+15px;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -151,7 +151,7 @@ func createRepo(ctx *middleware.Context, owner *models.User, opt api.CreateRepoO
|
||||
} else {
|
||||
log.Error(4, "CreateRepository: %v", err)
|
||||
if repo != nil {
|
||||
if err = models.DeleteRepository(ctx.User.Id, repo.ID, ctx.User.Name); err != nil {
|
||||
if err = models.DeleteRepository(ctx.User.Id, repo.ID); err != nil {
|
||||
log.Error(4, "DeleteRepository: %v", err)
|
||||
}
|
||||
}
|
||||
@@ -256,7 +256,7 @@ func MigrateRepo(ctx *middleware.Context, form auth.MigrateRepoForm) {
|
||||
repo, err := models.MigrateRepository(ctxUser, form.RepoName, form.Description, form.Private, form.Mirror, remoteAddr)
|
||||
if err != nil {
|
||||
if repo != nil {
|
||||
if errDelete := models.DeleteRepository(ctxUser.Id, repo.ID, ctxUser.Name); errDelete != nil {
|
||||
if errDelete := models.DeleteRepository(ctxUser.Id, repo.ID); errDelete != nil {
|
||||
log.Error(4, "DeleteRepository: %v", errDelete)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -126,7 +126,7 @@ func CreatePost(ctx *middleware.Context, form auth.CreateRepoForm) {
|
||||
}
|
||||
|
||||
if repo != nil {
|
||||
if errDelete := models.DeleteRepository(ctxUser.Id, repo.ID, ctxUser.Name); errDelete != nil {
|
||||
if errDelete := models.DeleteRepository(ctxUser.Id, repo.ID); errDelete != nil {
|
||||
log.Error(4, "DeleteRepository: %v", errDelete)
|
||||
}
|
||||
}
|
||||
@@ -192,7 +192,7 @@ func MigratePost(ctx *middleware.Context, form auth.MigrateRepoForm) {
|
||||
}
|
||||
|
||||
if repo != nil {
|
||||
if errDelete := models.DeleteRepository(ctxUser.Id, repo.ID, ctxUser.Name); errDelete != nil {
|
||||
if errDelete := models.DeleteRepository(ctxUser.Id, repo.ID); errDelete != nil {
|
||||
log.Error(4, "DeleteRepository: %v", errDelete)
|
||||
}
|
||||
}
|
||||
|
||||
+10
-4
@@ -53,10 +53,12 @@ func SettingsPost(ctx *middleware.Context, form auth.RepoSettingForm) {
|
||||
return
|
||||
}
|
||||
|
||||
isNameChanged := false
|
||||
oldRepoName := repo.Name
|
||||
newRepoName := form.RepoName
|
||||
// Check if repository name has been changed.
|
||||
if repo.LowerName != strings.ToLower(newRepoName) {
|
||||
isNameChanged = true
|
||||
if err := models.ChangeRepositoryName(ctx.Repo.Owner, repo.Name, newRepoName); err != nil {
|
||||
ctx.Data["Err_RepoName"] = true
|
||||
switch {
|
||||
@@ -71,6 +73,7 @@ func SettingsPost(ctx *middleware.Context, form auth.RepoSettingForm) {
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
log.Trace("Repository name changed: %s/%s -> %s", ctx.Repo.Owner.Name, repo.Name, newRepoName)
|
||||
}
|
||||
// In case it's just a case change.
|
||||
@@ -87,12 +90,15 @@ func SettingsPost(ctx *middleware.Context, form auth.RepoSettingForm) {
|
||||
if err := models.UpdateRepository(repo, visibilityChanged); err != nil {
|
||||
ctx.Handle(500, "UpdateRepository", err)
|
||||
return
|
||||
} else if err = models.RenameRepoAction(ctx.User, oldRepoName, repo); err != nil {
|
||||
ctx.Handle(500, "RenameRepoAction", err)
|
||||
return
|
||||
}
|
||||
log.Trace("Repository updated: %s/%s", ctx.Repo.Owner.Name, repo.Name)
|
||||
|
||||
if isNameChanged {
|
||||
if err := models.RenameRepoAction(ctx.User, oldRepoName, repo); err != nil {
|
||||
log.Error(4, "RenameRepoAction: %v", err)
|
||||
}
|
||||
}
|
||||
|
||||
if repo.IsMirror {
|
||||
if form.Interval > 0 {
|
||||
ctx.Repo.Mirror.Interval = form.Interval
|
||||
@@ -152,7 +158,7 @@ func SettingsPost(ctx *middleware.Context, form auth.RepoSettingForm) {
|
||||
}
|
||||
}
|
||||
|
||||
if err := models.DeleteRepository(ctx.Repo.Owner.Id, repo.ID, ctx.Repo.Owner.Name); err != nil {
|
||||
if err := models.DeleteRepository(ctx.Repo.Owner.Id, repo.ID); err != nil {
|
||||
ctx.Handle(500, "DeleteRepository", err)
|
||||
return
|
||||
}
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
{{template "base/alert" .}}
|
||||
<div class="inline required field {{if .Err_Owner}}error{{end}}">
|
||||
<label>{{.i18n.Tr "repo.owner"}}</label>
|
||||
<div class="ui selection dropdown">
|
||||
<div class="ui selection owner dropdown">
|
||||
<input type="hidden" id="uid" name="uid" value="{{.ContextUser.Id}}" required>
|
||||
<span class="text">
|
||||
<img class="ui mini image" src="{{.ContextUser.AvatarLink}}">
|
||||
|
||||
@@ -45,7 +45,7 @@
|
||||
</div>
|
||||
<div class="inline field">
|
||||
<label>{{.i18n.Tr "repo.visibility"}}</label>
|
||||
<div class="ui read-only toggle checkbox">
|
||||
<div class="ui read-only checkbox">
|
||||
<input type="checkbox" {{if .IsPrivate}}checked{{end}}>
|
||||
<label>{{.i18n.Tr "repo.visiblity_helper" | Safe}}</label>
|
||||
</div>
|
||||
|
||||
@@ -47,7 +47,7 @@
|
||||
<label>{{.i18n.Tr "repo.visibility"}}</label>
|
||||
<div class="ui checkbox">
|
||||
<input name="private" type="checkbox" {{if .Repository.IsPrivate}}checked{{end}}>
|
||||
<label>{{.i18n.Tr "repo.visiblity_helper" | Safe}}</label>
|
||||
<label>{{.i18n.Tr "repo.visiblity_helper" | Safe}} {{if .Repository.NumForks}}<span class="text red">{{.i18n.Tr "repo.visiblity_fork_helper"}}</span>{{end}}</label>
|
||||
</div>
|
||||
</div>
|
||||
{{end}}
|
||||
@@ -138,6 +138,11 @@
|
||||
<div class="ui warning message text left">
|
||||
{{.i18n.Tr "repo.settings.delete_notices_1" | Safe}} <br>
|
||||
{{.i18n.Tr "repo.settings.delete_notices_2" | Safe}}
|
||||
{{if .Repository.NumForks}}<br>
|
||||
{{.i18n.Tr "repo.settings.delete_notices_fork_1" | Safe}} <br>
|
||||
{{.i18n.Tr "repo.settings.delete_notices_fork_2" | Safe}} <br>
|
||||
{{.i18n.Tr "repo.settings.delete_notices_fork_3" | Safe}}
|
||||
{{end}}
|
||||
</div>
|
||||
<form class="ui form" action="{{.Link}}" method="post">
|
||||
{{.CsrfTokenHtml}}
|
||||
|
||||
Reference in new issue
Block a user