core.startGroup('Persisting credentials for submodules');
yield authHelper.configureSubmoduleAuth();
core.endGroup();
}
}
finally {
@@ -5901,7 +5915,9 @@ function getSource(settings) {
finally {
// Remove auth
if (!settings.persistCredentials) {
core.startGroup('Removing auth');
yield authHelper.removeAuth();
core.endGroup();
}
}
});
@@ -7241,6 +7257,7 @@ function prepareExistingDirectory(git, repositoryPath, preferredRemoteUrl, allow
}
}
try {
core.startGroup('Removing previously created refs, to avoid conflicts');
// Checkout detached HEAD
if (!(yield git.isDetached())) {
yield git.checkoutDetach();
@@ -7255,8 +7272,10 @@ function prepareExistingDirectory(git, repositoryPath, preferredRemoteUrl, allow
for (const branch of branches) {
yield git.branchDelete(true, branch);
}
core.endGroup();
// Clean
if (clean) {
core.startGroup('Cleaning the repository');
if (!(yield git.tryClean())) {
core.debug(`The clean command failed. This might be caused by: 1) path too long, 2) permission issue, or 3) file in use. For futher investigation, manually run 'git clean -ffdx' on the directory '${repositoryPath}'.`);
remove = true;
@@ -7264,6 +7283,7 @@ function prepareExistingDirectory(git, repositoryPath, preferredRemoteUrl, allow
else if (!(yield git.tryReset())) {
remove = true;
}
core.endGroup();
if (remove) {
core.warning(`Unable to clean or reset the repository. The repository will be recreated instead.`);
Changes for src/git-directory-helper.ts: 4 added lines, 0 removed lines.
Original line number
Diff line number
Diff line
@@ -53,6 +53,7 @@ export async function prepareExistingDirectory(
}
try{
core.startGroup('Removing previously created refs, to avoid conflicts')
// Checkout detached HEAD
if (!(awaitgit.isDetached())){
awaitgit.checkoutDetach()
@@ -69,9 +70,11 @@ export async function prepareExistingDirectory(
for (constbranchofbranches){
awaitgit.branchDelete(true,branch)
}
core.endGroup()
// Clean
if (clean){
core.startGroup('Cleaning the repository')
if (!(awaitgit.tryClean())){
core.debug(
`The clean command failed. This might be caused by: 1) path too long, 2) permission issue, or 3) file in use. For futher investigation, manually run 'git clean -ffdx' on the directory '${repositoryPath}'.`
@@ -80,6 +83,7 @@ export async function prepareExistingDirectory(