Make sure to retrieve the correct tag info when there is no commit attached to the tag

This commit is contained in:
Jérémie Astori 2019-01-29 01:04:30 -05:00
parent bd5cbba03e
commit 85d87a3b37
No known key found for this signature in database
GPG Key ID: B9A4F245CD67BDE8

View File

@ -227,6 +227,7 @@ class RepositoryFetcher {
repository(owner: "thelounge", name: $repositoryName) { repository(owner: "thelounge", name: $repositoryName) {
ref(qualifiedName: $tag) { ref(qualifiedName: $tag) {
tag: target { tag: target {
oid
... on Tag { ... on Tag {
commit: target { commit: target {
oid oid
@ -237,7 +238,7 @@ class RepositoryFetcher {
} }
}`; }`;
const data = await this.fetch(tagQuery, {tag}); const data = await this.fetch(tagQuery, {tag});
return data.repository.ref.tag.commit; return data.repository.ref.tag.commit || data.repository.ref.tag;
} }
// Returns an array of annotated commits that have been made on the master // Returns an array of annotated commits that have been made on the master