mirror of
https://github.com/jesseduffield/lazygit.git
synced 2026-08-24 10:13:41 -05:00
Remove now unused code
Doing this in a separate commit makes the previous commit's diff easier to read.
This commit is contained in:
@@ -342,46 +342,3 @@ func graphQLEndpoint(host string) string {
|
||||
}
|
||||
return "https://" + host + "/api/graphql"
|
||||
}
|
||||
|
||||
func (self *GitHubCommands) InGithubRepo(remotes []*models.Remote) bool {
|
||||
if len(remotes) == 0 {
|
||||
return false
|
||||
}
|
||||
|
||||
remote := getMainRemote(remotes)
|
||||
|
||||
if len(remote.Urls) == 0 {
|
||||
return false
|
||||
}
|
||||
|
||||
url := remote.Urls[0]
|
||||
return strings.Contains(strings.ToLower(url), "github.com")
|
||||
}
|
||||
|
||||
func getMainRemote(remotes []*models.Remote) *models.Remote {
|
||||
for _, remote := range remotes {
|
||||
if remote.Name == "origin" {
|
||||
return remote
|
||||
}
|
||||
}
|
||||
|
||||
// need to sort remotes by name so that this is deterministic
|
||||
return lo.MinBy(remotes, func(a, b *models.Remote) bool {
|
||||
return a.Name < b.Name
|
||||
})
|
||||
}
|
||||
|
||||
func (self *GitHubCommands) GetBaseRepoOwnerAndName(baseRemote *models.Remote) (string, string, error) {
|
||||
if len(baseRemote.Urls) == 0 {
|
||||
return "", "", fmt.Errorf("No URLs found for remote")
|
||||
}
|
||||
|
||||
url := baseRemote.Urls[0]
|
||||
|
||||
repoInfo, err := hosting_service.GetRepoInfoFromURL(url)
|
||||
if err != nil {
|
||||
return "", "", err
|
||||
}
|
||||
|
||||
return repoInfo.Owner, repoInfo.Repository, nil
|
||||
}
|
||||
|
||||
@@ -21,10 +21,6 @@ func (self *HostingService) GetCommitURL(commitSha string) (string, error) {
|
||||
return self.getHostingServiceMgr(self.config.GetRemoteURL()).GetCommitURL(commitSha)
|
||||
}
|
||||
|
||||
func (self *HostingService) GetRepoNameFromRemoteURL(remoteURL string) (string, error) {
|
||||
return self.getHostingServiceMgr(remoteURL).GetRepoName()
|
||||
}
|
||||
|
||||
func (self *HostingService) GetServiceInfo(remoteURL string) (hosting_service.ServiceInfo, error) {
|
||||
return self.getHostingServiceMgr(remoteURL).GetServiceInfo()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user