mirror of
https://github.com/actions/checkout.git
synced 2025-05-24 10:15:09 +02:00
added filter option & tests
This commit is contained in:
parent
96f53100ba
commit
99fc22de1f
7 changed files with 46 additions and 1 deletions
|
@ -154,7 +154,13 @@ export async function getSource(settings: IGitSourceSettings): Promise<void> {
|
|||
// Fetch
|
||||
core.startGroup('Fetching the repository')
|
||||
const fetchOptions: {filter?: string; fetchDepth?: number} = {}
|
||||
if (settings.sparseCheckout) fetchOptions.filter = 'blob:none'
|
||||
|
||||
if (settings.filter) {
|
||||
fetchOptions.filter = settings.filter
|
||||
} else if (settings.sparseCheckout) {
|
||||
fetchOptions.filter = 'blob:none'
|
||||
}
|
||||
|
||||
if (settings.fetchDepth <= 0) {
|
||||
// Fetch all branches and tags
|
||||
let refSpec = refHelper.getRefSpecForAllHistory(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue