mirror of
https://github.com/harness/drone.git
synced 2025-05-20 10:59:56 +08:00
revert repo change to visilbity
This commit is contained in:
parent
6076621ada
commit
b37cbd7771
@ -28,8 +28,8 @@ import (
|
|||||||
|
|
||||||
type (
|
type (
|
||||||
repositoryInput struct {
|
repositoryInput struct {
|
||||||
Visibility string `json:"visibility"`
|
Visibility *string `json:"visibility"`
|
||||||
Config string `json:"config_path"`
|
Config *string `json:"config_path"`
|
||||||
Trusted *bool `json:"trusted"`
|
Trusted *bool `json:"trusted"`
|
||||||
Protected *bool `json:"protected"`
|
Protected *bool `json:"protected"`
|
||||||
IgnoreForks *bool `json:"ignore_forks"`
|
IgnoreForks *bool `json:"ignore_forks"`
|
||||||
@ -75,11 +75,11 @@ func HandleUpdate(repos core.RepositoryStore) http.HandlerFunc {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
if in.Visibility != "" {
|
if in.Visibility != nil {
|
||||||
repo.Visibility = in.Visibility
|
repo.Visibility = *in.Visibility
|
||||||
}
|
}
|
||||||
if in.Config != "" {
|
if in.Config != nil {
|
||||||
repo.Config = in.Config
|
repo.Config = *in.Config
|
||||||
}
|
}
|
||||||
if in.Protected != nil {
|
if in.Protected != nil {
|
||||||
repo.Protected = *in.Protected
|
repo.Protected = *in.Protected
|
||||||
|
@ -242,6 +242,7 @@ func TestUpdateAutoCancelRunning(t *testing.T) {
|
|||||||
|
|
||||||
repoInput := &core.Repository{
|
repoInput := &core.Repository{
|
||||||
CancelRunning: true,
|
CancelRunning: true,
|
||||||
|
Visibility: core.VisibilityPrivate,
|
||||||
}
|
}
|
||||||
|
|
||||||
shouldBeValue := true
|
shouldBeValue := true
|
||||||
|
Loading…
Reference in New Issue
Block a user