0
1
Fork 0
mirror of https://github.com/actions/checkout synced 2024-06-17 14:28:20 +02:00
This commit is contained in:
David Allsopp 2023-01-24 14:50:09 +05:30 committed by GitHub
commit e1b045a734
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 6 deletions

6
dist/index.js vendored
View file

@ -9387,8 +9387,10 @@ function prepareExistingDirectory(git, repositoryPath, repositoryUrl, clean, ref
remove = true;
}
// Fetch URL does not match
else if (!fsHelper.directoryExistsSync(path.join(repositoryPath, '.git')) ||
repositoryUrl !== (yield git.tryGetFetchUrl())) {
else if (!fsHelper.directoryExistsSync(path.join(repositoryPath, '.git'))) {
remove = clean;
}
else if (repositoryUrl !== (yield git.tryGetFetchUrl())) {
remove = true;
}
else {

View file

@ -24,10 +24,10 @@ export async function prepareExistingDirectory(
remove = true
}
// Fetch URL does not match
else if (
!fsHelper.directoryExistsSync(path.join(repositoryPath, '.git')) ||
repositoryUrl !== (await git.tryGetFetchUrl())
) {
else if (!fsHelper.directoryExistsSync(path.join(repositoryPath, '.git'))) {
remove = clean
}
else if (repositoryUrl !== (await git.tryGetFetchUrl())) {
remove = true
} else {
// Delete any index.lock and shallow.lock left by a previously canceled run or crashed git process