Selaa lähdekoodia

update gitlab.com/gitote/go-gitote-client

Yoginth 7 vuotta sitten
vanhempi
commit
a7b2855c33

+ 1 - 0
models/user.go

@@ -162,6 +162,7 @@ func (u *User) APIFormat() *api.User {
 	return &api.User{
 		ID:               u.ID,
 		UserName:         u.Name,
+		Login:            u.Name,
 		FullName:         u.FullName,
 		Website:          u.Website,
 		Company:          u.Company,

+ 1 - 0
pkg/context/context.go

@@ -286,6 +286,7 @@ func Contexter() macaron.Handler {
 				"CloneLink":      models.ComposeHTTPSCloneURL(ownerName, repoName),
 				"GoDocDirectory": prefix + "{/dir}",
 				"GoDocFile":      prefix + "{/dir}/{file}#L{line}",
+				"InsecureFlag":   insecureFlag,
 			})))
 			return
 		}

+ 2 - 7
routes/api/v1/repo/collaborators.go

@@ -11,19 +11,14 @@ import (
 func ListCollaborators(c *context.APIContext) {
 	collaborators, err := c.Repo.Repository.GetCollaborators()
 	if err != nil {
-		if errors.IsUserNotExist(err) {
-			c.Error(422, "", err)
-		} else {
-			c.Error(500, "GetCollaborators", err)
-		}
-		return
+		c.ServerError("GetCollaborators", err)
 	}
 
 	apiCollaborators := make([]*api.Collaborator, len(collaborators))
 	for i := range collaborators {
 		apiCollaborators[i] = collaborators[i].APIFormat()
 	}
-	c.JSON(200, &apiCollaborators)
+	c.JSONSuccess(&apiCollaborators)
 }
 
 func AddCollaborator(c *context.APIContext, form api.AddCollaboratorOption) {

+ 1 - 1
vendor/gitlab.com/gitote/go-gitote-client/gitote.go

@@ -10,7 +10,7 @@ import (
 )
 
 func Version() string {
-	return "0.12.12"
+	return "0.12.14"
 }
 
 // Client represents a Gitote API client.

+ 2 - 13
vendor/gitlab.com/gitote/go-gitote-client/user.go

@@ -1,7 +1,6 @@
 package gitote
 
 import (
-	"encoding/json"
 	"fmt"
 	"time"
 )
@@ -9,7 +8,8 @@ import (
 // User represents a API user.
 type User struct {
 	ID               int64     `json:"id"`
-	UserName         string    `json:"login"`
+	UserName         string    `json:"username"` // LEGACY [Gitote 1.0]: remove field(s) for backward compatibility
+	Login            string    `json:"login"`
 	FullName         string    `json:"full_name"`
 	Website          string    `json:"website"`
 	Email            string    `json:"email"`
@@ -29,17 +29,6 @@ type User struct {
 	ReposURL         string    `json:"repos_url"`
 }
 
-// MarshalJSON implements the json.Marshaler interface for User
-func (u User) MarshalJSON() ([]byte, error) {
-	// Re-declaring User to avoid recursion
-	type shadow User
-	return json.Marshal(struct {
-		shadow
-		// LEGACY [Gitote 1.0]: remove field(s) for backward compatibility
-		CompatUserName string `json:"username"`
-	}{shadow(u), u.UserName})
-}
-
 func (c *Client) GetUserInfo(user string) (*User, error) {
 	u := new(User)
 	err := c.getParsedResponse("GET", fmt.Sprintf("/users/%s", user), nil, nil, u)

+ 2 - 2
vendor/vendor.json

@@ -471,9 +471,9 @@
 			"revisionTime": "2018-08-17T15:03:56Z"
 		},
 		{
-			"checksumSHA1": "J/f+QGYC5Taz51+I4iWEWnjUPQw=",
+			"checksumSHA1": "oHebHgd34mC2BaDjCzTcyJYXumg=",
 			"path": "gitlab.com/gitote/go-gitote-client",
-			"revision": "ee1e4755b3afc9d52bfcf5f672ed96d24147d5cf",
+			"revision": "be908b88e1cfc9dbed4fa382fcf36d8e32bf5efb",
 			"revisionTime": "2017-06-02T18:25:02Z"
 		},
 		{