Merge pull request #1189 from mikepenz/feature/optimize_tag_retrieval
Optimize tag retrieval if fully specified
This commit is contained in:
+9762
-25073
File diff suppressed because one or more lines are too long
+1
-1
File diff suppressed because one or more lines are too long
@@ -140,6 +140,9 @@ export class Tags {
|
|||||||
maxTagsToFetch: number,
|
maxTagsToFetch: number,
|
||||||
tagResolver: TagResolver
|
tagResolver: TagResolver
|
||||||
): Promise<TagResult> {
|
): Promise<TagResult> {
|
||||||
|
let tags: TagInfo[] = []
|
||||||
|
|
||||||
|
if (!toTag || !fromTag) {
|
||||||
// filter out tags not matching the specified filter
|
// filter out tags not matching the specified filter
|
||||||
const filteredTags = filterTags(
|
const filteredTags = filterTags(
|
||||||
// retrieve the tags from the API
|
// retrieve the tags from the API
|
||||||
@@ -171,7 +174,7 @@ export class Tags {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// sort tags, apply additional information (e.g. if tag is a pre release)
|
// sort tags, apply additional information (e.g. if tag is a pre release)
|
||||||
let tags = prepareAndSortTags(transformedTags, tagResolver)
|
tags = prepareAndSortTags(transformedTags, tagResolver)
|
||||||
|
|
||||||
if (transformed) {
|
if (transformed) {
|
||||||
// restore the original name, after sorting
|
// restore the original name, after sorting
|
||||||
@@ -183,6 +186,7 @@ export class Tags {
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
let resultToTag: TagInfo | null
|
let resultToTag: TagInfo | null
|
||||||
let resultFromTag: TagInfo | null
|
let resultFromTag: TagInfo | null
|
||||||
|
|||||||
Reference in New Issue
Block a user