mirror of
https://forgejo.mixinet.net/actions/checkout.git
synced 2025-06-15 14:50:45 -06:00
Tweak clean: false
when there's no .git dir
If the checkout directory doesn't contain .git, previously the action always erased the entire directory: now, it only does it if the clean input is true (which is the default). This means that files set-up _before_ actions/checkout is used do not get erased before cloning and checkout the repository.
This commit is contained in:
parent
25a956c84d
commit
44b7815b62
2 changed files with 9 additions and 7 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue