Skip to content

Commit

Permalink
remove dead and confusing code
Browse files Browse the repository at this point in the history
  • Loading branch information
djeebus committed Dec 21, 2023
1 parent 87e4a3e commit 7fa4f01
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 32 deletions.
6 changes: 1 addition & 5 deletions pkg/diff/diff.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,7 @@ type objKeyLiveTarget struct {
}

func isAppMissingErr(err error) bool {
if strings.Contains(err.Error(), "PermissionDenied") {
return true
}

return false
return strings.Contains(err.Error(), "PermissionDenied")
}

/*
Expand Down
18 changes: 0 additions & 18 deletions pkg/vcs/github_client/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -116,24 +116,6 @@ func (c *Client) ParseHook(r *http.Request, request []byte) (*repo.Repo, error)
}
}

// We need an email and username for authenticating our local git repository
// Grab the current authenticated client login and email
func (c *Client) getUserDetails() (string, string, error) {
user, _, err := c.Users.Get(context.Background(), "")
if err != nil {
return "", "", err
}

// Some users on GitHub don't have an email listed; if so, catch that and return empty string
if user.Email == nil {
log.Error().Msg("could not load Github user email")
return *user.Login, "", nil
}

return *user.Login, *user.Email, nil

}

func (c *Client) buildRepoFromEvent(event *github.PullRequestEvent) *repo.Repo {
var labels []string
for _, label := range event.PullRequest.Labels {
Expand Down
9 changes: 0 additions & 9 deletions pkg/vcs/gitlab_client/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,15 +56,6 @@ func CreateGitlabClient() (*Client, error) {
return &Client{Client: c, username: user.Username, email: user.Email}, nil
}

func (c *Client) getTokenUser() (string, string) {
user, _, err := c.Users.CurrentUser()
if err != nil {
log.Fatal().Err(err).Msg("could not create Gitlab token user")
}

return user.Username, user.Email
}

func (c *Client) Email() string { return c.email }
func (c *Client) Username() string { return c.username }
func (c *Client) GetName() string {
Expand Down

0 comments on commit 7fa4f01

Please sign in to comment.