mirror of
https://github.com/gogs/gogs.git
synced 2025-05-31 11:42:13 +00:00
repo: change action visibility when repository visibility changed (#4414)
This commit is contained in:
parent
4400d2fdd9
commit
a887e475e3
2
gogs.go
2
gogs.go
@ -16,7 +16,7 @@ import (
|
|||||||
"github.com/gogits/gogs/pkg/setting"
|
"github.com/gogits/gogs/pkg/setting"
|
||||||
)
|
)
|
||||||
|
|
||||||
const APP_VER = "0.11.19.0611"
|
const APP_VER = "0.11.20.0611"
|
||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
setting.AppVer = APP_VER
|
setting.AppVer = APP_VER
|
||||||
|
@ -21,8 +21,8 @@ import (
|
|||||||
api "github.com/gogits/go-gogs-client"
|
api "github.com/gogits/go-gogs-client"
|
||||||
|
|
||||||
"github.com/gogits/gogs/models/errors"
|
"github.com/gogits/gogs/models/errors"
|
||||||
"github.com/gogits/gogs/pkg/tool"
|
|
||||||
"github.com/gogits/gogs/pkg/setting"
|
"github.com/gogits/gogs/pkg/setting"
|
||||||
|
"github.com/gogits/gogs/pkg/tool"
|
||||||
)
|
)
|
||||||
|
|
||||||
type ActionType int
|
type ActionType int
|
||||||
@ -78,7 +78,7 @@ type Action struct {
|
|||||||
ActUserID int64 // Action user id.
|
ActUserID int64 // Action user id.
|
||||||
ActUserName string // Action user name.
|
ActUserName string // Action user name.
|
||||||
ActAvatar string `xorm:"-"`
|
ActAvatar string `xorm:"-"`
|
||||||
RepoID int64
|
RepoID int64 `xorm:"INDEX"`
|
||||||
RepoUserName string
|
RepoUserName string
|
||||||
RepoName string
|
RepoName string
|
||||||
RefName string
|
RefName string
|
||||||
|
@ -1369,6 +1369,11 @@ func updateRepository(e Engine, repo *Repository, visibilityChanged bool) (err e
|
|||||||
return fmt.Errorf("updateRepository[%d]: %v", forkRepos[i].ID, err)
|
return fmt.Errorf("updateRepository[%d]: %v", forkRepos[i].ID, err)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Change visibility of generated actions
|
||||||
|
if _, err = e.Where("repo_id = ?", repo.ID).Cols("is_private").Update(&Action{IsPrivate: repo.IsPrivate}); err != nil {
|
||||||
|
return fmt.Errorf("change action visibility of repository [id: %d]: %v", repo.ID, err)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
@ -1376,7 +1381,7 @@ func updateRepository(e Engine, repo *Repository, visibilityChanged bool) (err e
|
|||||||
|
|
||||||
func UpdateRepository(repo *Repository, visibilityChanged bool) (err error) {
|
func UpdateRepository(repo *Repository, visibilityChanged bool) (err error) {
|
||||||
sess := x.NewSession()
|
sess := x.NewSession()
|
||||||
defer sessionRelease(sess)
|
defer sess.Close()
|
||||||
if err = sess.Begin(); err != nil {
|
if err = sess.Begin(); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
@ -1 +1 @@
|
|||||||
0.11.19.0611
|
0.11.20.0611
|
Loading…
x
Reference in New Issue
Block a user