mirror of
https://forgejo.mixinet.net/actions/checkout.git
synced 2025-06-15 14:50:45 -06:00
Verify minimum Git version for sparse checkout
The `git sparse-checkout` command is available only since Git version v2.25.0. The `actions/checkout` Action actually supports older Git versions than that; As of time of writing, the minimum version is v2.18.0. Instead of raising this minimum version even for users who do not require a sparse checkout, only check for this minimum version specifically when a sparse checkout was asked for. Suggested-by: Tingluo Huang <tingluohuang@github.com> Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
This commit is contained in:
parent
a241939688
commit
1b203d18c7
4 changed files with 62 additions and 16 deletions
|
@ -275,7 +275,11 @@ export async function cleanup(repositoryPath: string): Promise<void> {
|
|||
|
||||
let git: IGitCommandManager
|
||||
try {
|
||||
git = await gitCommandManager.createCommandManager(repositoryPath, false)
|
||||
git = await gitCommandManager.createCommandManager(
|
||||
repositoryPath,
|
||||
false,
|
||||
false
|
||||
)
|
||||
} catch {
|
||||
return
|
||||
}
|
||||
|
@ -311,7 +315,8 @@ async function getGitCommandManager(
|
|||
try {
|
||||
return await gitCommandManager.createCommandManager(
|
||||
settings.repositoryPath,
|
||||
settings.lfs
|
||||
settings.lfs,
|
||||
settings.sparseCheckout != null
|
||||
)
|
||||
} catch (err) {
|
||||
// Git is required for LFS
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue