[bridge/github] import: avoid retrieving ghost email in userQuery

Amine Hilaly created

request

rename userQuery to ghostQuery

Change summary

bridge/github/import.go       | 4 ++--
bridge/github/import_query.go | 3 +--
2 files changed, 3 insertions(+), 4 deletions(-)

Detailed changes

bridge/github/import.go 🔗

@@ -505,7 +505,7 @@ func (gi *githubImporter) getGhost(repo *cache.RepoCache) (*cache.IdentityCache,
 		return nil, err
 	}
 
-	var q userQuery
+	var q ghostQuery
 
 	variables := map[string]interface{}{
 		"login": githubv4.String("ghost"),
@@ -529,7 +529,7 @@ func (gi *githubImporter) getGhost(repo *cache.RepoCache) (*cache.IdentityCache,
 
 	return repo.NewIdentityRaw(
 		name,
-		string(q.User.Email),
+		"",
 		string(q.User.Login),
 		string(q.User.AvatarUrl),
 		map[string]string{

bridge/github/import_query.go 🔗

@@ -160,12 +160,11 @@ type commentEditQuery struct {
 	} `graphql:"repository(owner: $owner, name: $name)"`
 }
 
-type userQuery struct {
+type ghostQuery struct {
 	User struct {
 		Login     githubv4.String
 		AvatarUrl githubv4.String
 		Name      *githubv4.String
-		Email     githubv4.String
 	} `graphql:"user(login: $login)"`
 }