diff options
Diffstat (limited to 'internal/context')
-rw-r--r-- | internal/context/auth.go | 2 | ||||
-rw-r--r-- | internal/context/repo.go | 4 |
2 files changed, 3 insertions, 3 deletions
diff --git a/internal/context/auth.go b/internal/context/auth.go index 6e67d8ef..5f64161a 100644 --- a/internal/context/auth.go +++ b/internal/context/auth.go @@ -117,7 +117,7 @@ func authenticatedUserID(c *macaron.Context, sess session.Store) (_ int64, isTok if len(tokenSHA) <= 0 { tokenSHA = c.Query("access_token") } - if len(tokenSHA) == 0 { + if tokenSHA == "" { // Well, check with header again. auHead := c.Req.Header.Get("Authorization") if len(auHead) > 0 { diff --git a/internal/context/repo.go b/internal/context/repo.go index 01759212..f7eca673 100644 --- a/internal/context/repo.go +++ b/internal/context/repo.go @@ -284,7 +284,7 @@ func RepoAssignment(pages ...bool) macaron.Handler { // If not branch selected, try default one. // If default branch doesn't exists, fall back to some other branch. - if len(c.Repo.BranchName) == 0 { + if c.Repo.BranchName == "" { if len(c.Repo.Repository.DefaultBranch) > 0 && gitRepo.HasBranch(c.Repo.Repository.DefaultBranch) { c.Repo.BranchName = c.Repo.Repository.DefaultBranch } else if len(branches) > 0 { @@ -322,7 +322,7 @@ func RepoRef() macaron.Handler { } // Get default branch. - if len(c.Params("*")) == 0 { + if c.Params("*") == "" { refName = c.Repo.Repository.DefaultBranch if !c.Repo.GitRepo.HasBranch(refName) { branches, err := c.Repo.GitRepo.Branches() |