From c4360747a3bdd0d5a5a673bfcdee05f9d911ba1e Mon Sep 17 00:00:00 2001 From: Achilleas Koutsou Date: Thu, 3 Sep 2020 21:04:22 +0200 Subject: repo: support unlisted but publicly accessible repositories (#6176) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: ᴜɴᴋɴᴡᴏɴ --- internal/db/action.go | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'internal/db/action.go') diff --git a/internal/db/action.go b/internal/db/action.go index 77938f02..d744162f 100644 --- a/internal/db/action.go +++ b/internal/db/action.go @@ -188,7 +188,7 @@ func newRepoAction(e Engine, doer, owner *User, repo *Repository) (err error) { RepoID: repo.ID, RepoUserName: repo.Owner.Name, RepoName: repo.Name, - IsPrivate: repo.IsPrivate, + IsPrivate: repo.IsPrivate || repo.IsUnlisted, }) } @@ -205,7 +205,7 @@ func renameRepoAction(e Engine, actUser *User, oldRepoName string, repo *Reposit RepoID: repo.ID, RepoUserName: repo.Owner.Name, RepoName: repo.Name, - IsPrivate: repo.IsPrivate, + IsPrivate: repo.IsPrivate || repo.IsUnlisted, Content: oldRepoName, }); err != nil { return fmt.Errorf("notify watchers: %v", err) @@ -512,7 +512,7 @@ func CommitRepoAction(opts CommitRepoActionOptions) error { RepoUserName: repo.MustOwner().Name, RepoName: repo.Name, RefName: refName, - IsPrivate: repo.IsPrivate, + IsPrivate: repo.IsPrivate || repo.IsUnlisted, } apiRepo := repo.APIFormat(nil) @@ -628,7 +628,7 @@ func transferRepoAction(e Engine, doer, oldOwner *User, repo *Repository) (err e RepoID: repo.ID, RepoUserName: repo.Owner.Name, RepoName: repo.Name, - IsPrivate: repo.IsPrivate, + IsPrivate: repo.IsPrivate || repo.IsUnlisted, Content: path.Join(oldOwner.Name, repo.Name), }); err != nil { return fmt.Errorf("notifyWatchers: %v", err) @@ -659,7 +659,7 @@ func mergePullRequestAction(e Engine, doer *User, repo *Repository, issue *Issue RepoID: repo.ID, RepoUserName: repo.Owner.Name, RepoName: repo.Name, - IsPrivate: repo.IsPrivate, + IsPrivate: repo.IsPrivate || repo.IsUnlisted, }) } @@ -678,7 +678,7 @@ func mirrorSyncAction(opType ActionType, repo *Repository, refName string, data RepoUserName: repo.MustOwner().Name, RepoName: repo.Name, RefName: refName, - IsPrivate: repo.IsPrivate, + IsPrivate: repo.IsPrivate || repo.IsUnlisted, }) } -- cgit v1.2.3