Read-only mirror — the public repositories of the Forgejo instance, refreshed every 10 minutes. The live instance (fg.dieschoenewolke.de) is reachable only over the VPN; clone here with https://git.dieschoenewolke.de/git/<owner>/<repo>.git.
summaryrefslogtreecommitdiff
path: root/src/git-directory-helper.ts
diff options
context:
space:
mode:
authoreric sciple <ericsciple@users.noreply.github.com>2020-03-27 13:12:15 -0400
committerGitHub <noreply@github.com>2020-03-27 13:12:15 -0400
commit10e37f5ca370a159eb6364bd241689e58d844f91 (patch)
tree2d03ad39da90db0da9aca6b6a4ebc043ea7b1924 /src/git-directory-helper.ts
parent18fd0bc59958dd73f02ac7a98cb5995f83e6f1de (diff)
group output (#191)v2.1.0
Diffstat (limited to 'src/git-directory-helper.ts')
-rw-r--r--src/git-directory-helper.ts10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/git-directory-helper.ts b/src/git-directory-helper.ts
index bfaa4a9..3866866 100644
--- a/src/git-directory-helper.ts
+++ b/src/git-directory-helper.ts
@@ -1,9 +1,11 @@
+import * as assert from 'assert'
import * as core from '@actions/core'
import * as fs from 'fs'
import * as fsHelper from './fs-helper'
import * as io from '@actions/io'
import * as path from 'path'
import {IGitCommandManager} from './git-command-manager'
+import {IGitSourceSettings} from './git-source-settings'
export async function prepareExistingDirectory(
git: IGitCommandManager | undefined,
@@ -11,6 +13,10 @@ export async function prepareExistingDirectory(
repositoryUrl: string,
clean: boolean
): Promise<void> {
+ assert.ok(repositoryPath, 'Expected repositoryPath to be defined')
+ assert.ok(repositoryUrl, 'Expected repositoryUrl to be defined')
+
+ // Indicates whether to delete the directory contents
let remove = false
// Check whether using git or REST API
@@ -38,6 +44,7 @@ export async function prepareExistingDirectory(
}
try {
+ core.startGroup('Removing previously created refs, to avoid conflicts')
// Checkout detached HEAD
if (!(await git.isDetached())) {
await git.checkoutDetach()
@@ -54,9 +61,11 @@ export async function prepareExistingDirectory(
for (const branch of branches) {
await git.branchDelete(true, branch)
}
+ core.endGroup()
// Clean
if (clean) {
+ core.startGroup('Cleaning the repository')
if (!(await 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}'.`
@@ -65,6 +74,7 @@ export async function prepareExistingDirectory(
} else if (!(await git.tryReset())) {
remove = true
}
+ core.endGroup()
if (remove) {
core.warning(